/* OrthoPlan Pro — Follow-up visits (6 Nov 2026 review, package FUP).
 *
 * Only what the new parts need to read right; the look itself is the design
 * layer's (op-zz-design.css). Colours are the registry's meanings (R-SYS-11):
 * amber = pending, red = overdue / late / not wearing / terminate, green =
 * done / paid / wearing.
 */

/* ---- Pending from the plan: the Follow-up header and the visit form ---- */
.op-frontend .op-followup-pending,
.op-frontend .op-visit-pending {
    border: 1px solid var(--op-warning);
    border-inline-start-width: 4px;
    background: var(--op-warning-bg);
    color: var(--op-warning-text);
    border-radius: var(--op-radius-sm, 8px);
    padding: var(--op-sp-2, 8px) var(--op-sp-3, 12px);
    margin: 0 0 var(--op-sp-3, 12px);
}
.op-frontend .op-followup-pending-title,
.op-frontend .op-visit-pending-title { display: block; font-size: 13px; font-weight: 800; margin: 0 0 4px; }
.op-frontend .op-visit-pending .op-field-hint { margin: 0 0 6px; }
.op-frontend .op-pending-lines,
.op-frontend .op-pending-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.op-frontend .op-pending-line { font-size: 13px; }
.op-frontend .op-pending-line.is-overdue,
.op-frontend .op-pending-item.is-overdue .op-pending-text { color: var(--op-danger-text); font-weight: 700; }
.op-frontend .op-pending-item {
    display: grid;
    gap: 6px;
    padding: 6px 0;
    border-top: 1px dashed var(--op-border-strong);
}
.op-frontend .op-pending-item:first-child { border-top: 0; }
.op-frontend .op-pending-text { margin: 0; font-size: 13px; font-weight: 600; color: var(--op-text); }
.op-frontend .op-pending-teeth .op-check-row { display: flex; flex-wrap: wrap; gap: 6px; }
.op-frontend .op-pending-tooth span { font-variant-numeric: tabular-nums; }

/* ---- Teeth out at an earlier visit, on the visit's charts (R-FUP-02) ----
 * fix/fup (R11-FUP-08): "make it very faded" — a faint grey outline, about a
 * fifth of a tooth, never the pale red that sat beside a debonded bracket's
 * red; inactive (op-followup.js disables it). Every visit chart: the
 * problems, the board, C and D. The plan's red "To extract" is not here. */
.op-frontend .op-visit-form .op-tc-tooth.is-extracted { opacity: .22; cursor: default; }
.op-frontend .op-visit-form .op-tc-tooth.is-extracted .op-tc-crown,
.op-frontend .op-visit-form .op-tc-tooth.is-extracted .op-tc-root { fill: var(--op-surface); stroke: var(--op-mark-extracted); stroke-dasharray: 3 2; }
.op-frontend .op-visit-form .op-tc-tooth.is-extracted .op-pm-marks,
.op-frontend .op-visit-form .op-tc-tooth.is-extracted .op-tc-partner { display: none; }
.op-frontend .op-visit-form .op-tc-tooth.is-extracted .op-tc-num { color: var(--op-text-muted); text-decoration: line-through; }

/* ---- Wearing it: the slider and Terminate (R-FUP-09 / R-FUP-11) ---- */
/* fix/fup (R11-MOB-03): held to the card. A grid row takes its widest chip's
   width, and in Arabic on a phone it pushed the page 16px sideways. */
.op-frontend .op-wear-list { grid-template-columns: minmax(0, 1fr); }
.op-frontend .op-wear-row { min-width: 0; }
.op-frontend .op-wear-row .op-field { min-width: 0; }
.op-frontend .op-wear-row .op-chips { flex-wrap: wrap; min-width: 0; }
/* "Wearing it sometimes (not as instructed)" is wider than a phone's row: it wraps inside its chip. */
.op-frontend .op-wear-row .op-chip { max-width: 100%; white-space: normal; text-align: start; overflow-wrap: anywhere; }
.op-frontend .op-wear-pct { display: flex; align-items: center; gap: var(--op-sp-2, 8px); flex: 1 1 220px; }
.op-frontend .op-wear-pct[hidden] { display: none; }
.op-frontend .op-wear-row .op-wear-pct .op-field-label { display: inline; }
.op-frontend .op-wear-range { flex: 1; min-width: 120px; accent-color: var(--op-warning); }
.op-frontend .op-wear-pct-out { font-weight: 700; min-width: 3.5em; font-variant-numeric: tabular-nums; color: var(--op-warning-text); }
.op-frontend .op-wear-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-inline-start: auto; }
.op-frontend .op-wear-row.is-terminated { border-color: var(--op-danger); background: var(--op-danger-bg); }
.op-frontend .op-wear-row.is-terminated .op-wear-name { text-decoration: line-through; }

/* ---- Common problems in groups, and their teeth (R-FUP-19 / R-FUP-20) ---- */
.op-frontend .op-problem-groups { display: grid; gap: var(--op-sp-2, 8px); }
.op-frontend .op-problem-group { display: grid; gap: 4px; }
.op-frontend .op-problem-group[hidden] { display: none; }
.op-frontend .op-problem-group-title {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--op-text-muted);
}

/* ---- The visit's record on its card (R-FUP-21) ---- */
.op-frontend .op-visit-record { display: grid; gap: var(--op-sp-2, 8px); margin-bottom: var(--op-sp-2, 8px); }
.op-frontend .op-visit-rec-items { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; }
.op-frontend .op-visit-rec-item.has-colour::before {
    content: "";
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--op-tool);
    margin-inline-end: 6px;
    vertical-align: middle;
}
.op-frontend .op-visit-rec-item.is-good { color: var(--op-success-text); }
.op-frontend .op-visit-rec-item.is-warn { color: var(--op-warning-text); font-weight: 600; }
.op-frontend .op-visit-rec-item.is-bad  { color: var(--op-danger-text); font-weight: 700; }
.op-frontend .op-visit-rec-next_visit_strategy .op-visit-rec-items { display: block; }
/* MOD (R-STM-20): each placed item with its own dot, in the shade the board draws it in (.op-mech-itemdot, op-mech.css). */
.op-frontend .op-visit-rec-part { overflow-wrap: anywhere; }
.op-frontend .op-visit-rec-part .op-mech-itemdot { vertical-align: middle; margin-inline-end: 3px; }

/* ---- Attendance (R-FUP-22) ---- */
.op-frontend .op-followup-attendance { margin: 2px 0 0; font-size: 12.5px; color: var(--op-text-muted); }
.op-frontend .op-followup-attendance.is-late { color: var(--op-late-text, var(--op-danger-text)); font-weight: 700; }
.op-frontend .op-visit-title .op-late { margin-inline-start: 6px; }

/* ---- Case alerts: the pending ones are not dismissable ---- */
.op-frontend .op-case-alert.op-case-alert-pending { border-color: var(--op-warning); background: var(--op-warning-bg); color: var(--op-warning-text); }
.op-frontend .op-case-alert.op-case-alert-pending.is-overdue { border-color: var(--op-danger); background: var(--op-danger-bg); color: var(--op-danger-text); }

/* ---- Instructions for the patient (R-FUP-12) ---- */
.op-frontend .op-instr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.op-frontend .op-instr-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px var(--op-sp-3, 12px);
    padding: 6px 0;
    border-top: 1px solid var(--op-border);
}
.op-frontend .op-instr-row:first-child { border-top: 0; }
.op-frontend .op-instr-name { font-weight: 700; flex: 1 1 140px; }
.op-frontend .op-instr-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.op-frontend .op-instr-acts [hidden] { display: none; }
.op-frontend .op-instr-form { flex: 1 1 100%; }
.op-frontend .op-instr-form[hidden] { display: none; }
.op-frontend .op-instr-plan { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 var(--op-sp-2, 8px); }
/* A long item name ("Instructions for the patient: Bonded Hyrax") wraps inside the screen on a phone. */
.op-frontend .op-instr-plan { min-width: 0; max-width: 100%; }
.op-frontend .op-instr-plan .op-btn { white-space: normal; max-width: 100%; height: auto; text-align: start; }
.op-frontend .op-instr-card .op-muted { margin-top: 0; }

/* ---- Hooks the script fills, and their spacing ---- */
.op-frontend .op-visit-part { display: block; }
.op-frontend .op-visit-part:empty { display: none; }
.op-frontend .op-pending-ask { display: grid; gap: 6px; }
.op-frontend .op-pending-tick { justify-self: start; }
.op-frontend .op-pending-onplan { margin: 0; font-style: italic; }
/* fix/look16 (R16-05): a to-do row's marker is drawn by the new look only. */
.op-frontend .op-todo-mark { display: none; }

/* =====================================================================
 * fix/fup (11 Nov 2026): the follow-up visit, calm and quick on a phone
 * ===================================================================== */

/* ---- "What the plan says for today": folded from visit 2, with a count (R11-FUP-04) ---- */
.op-frontend .op-visit-planned > .op-visit-sec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.op-frontend .op-plan-count {
    font-size: 12.5px;
    font-weight: 600;
    color: var(--op-warning-text);
    font-variant-numeric: tabular-nums;
}
.op-frontend .op-visit-planned.is-all-ticked .op-plan-count { color: var(--op-success-text); }
.op-frontend .op-plan-strategy-out { margin: 0 0 var(--op-sp-2, 8px); }
.op-frontend .op-plan-strategy-out[hidden] { display: none; }
/* Short columns, so twelve planned items are three rows on a tablet, not twelve. */
.op-frontend .op-plan-steps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
    gap: 6px var(--op-sp-2, 8px);
    align-items: start;
}
.op-frontend .op-plan-steps > .op-visit-sec-sub { grid-column: 1 / -1; margin: 6px 0 0; }
.op-frontend .op-plan-steps .op-planned-tile { min-width: 0; margin: 0; }
/* fix/complete (R16-07, STATUS (d)): a planned item reads whole, however long. The en masse line ("hook 22–23 to the
   TAD 24–25 … closed coil") was cut to two lines until the tile had focus; a tile of entries already shows every one
   (R11-STC-09), and a single long entry now does the same. */
.op-frontend .op-plan-steps .op-planned-tile > span {
    display: block;
    overflow-wrap: anywhere;
}
/* R11-STC-09: a tile of entries (the plan's Bracket modification) shows every entry, one a line; and the visit's
   record lists what was done from the plan, and its brackets, an entry a line (the acceptance walk, 13 Nov). */
.op-frontend .op-plan-steps .op-planned-tile > .op-planned-lines { display: grid; gap: 2px; -webkit-line-clamp: unset; overflow: visible; }
.op-frontend .op-plan-steps .op-planned-line { display: block; }
.op-frontend :is(.op-visit-rec-planned, .op-visit-rec-brackets) .op-visit-rec-items { display: block; }

/* ---- Compliance notes (R11-FUP-05) ---- */
.op-frontend .op-comp-notes { margin-top: var(--op-sp-2, 8px); }
.op-frontend .op-comp-notes > summary { cursor: pointer; color: var(--op-primary); }

/* ---- The board's mechanics in 3 · Mechanics (R11-FUP-06) ---- */
.op-frontend .op-chip.is-board {
    background: var(--op-primary-light);
    border-color: var(--op-primary);
    color: var(--op-primary-dark);
    font-weight: 600;
    cursor: default;
}
.op-frontend .op-chip-tag {
    margin-inline-start: 6px;
    padding: 0 5px;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    background: var(--op-primary);
    color: var(--op-primary-text);
}
.op-frontend .op-visit-mech-board { margin-top: -4px; }
.op-frontend .op-visit-mech-board-note { display: block; margin-top: 4px; }
.op-frontend .op-visit-mech-board-note[hidden] { display: none; }

/* ---- Problems: the words under the chips, then the one chart (R11-FUP-07/08/10) ---- */
.op-frontend .op-problem-words { margin-top: var(--op-sp-2, 8px); }
.op-frontend .op-chip.is-retired { font-style: italic; }
.op-frontend .op-chip.is-retired[hidden] { display: none; }

/* A grid item takes its content's width unless told otherwise: the six
 * stacked charts did, and on his phone the whole page widened to 743px and
 * shrank (R11-MOB-03). Every box here is held to the card; the teeth scroll
 * inside the board. */
.op-frontend .op-pm { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--op-sp-2, 8px); margin-top: var(--op-sp-3, 12px); min-width: 0; }
.op-frontend .op-pm[hidden] { display: none; }
.op-frontend .op-pm > * { min-width: 0; }
.op-frontend .op-pm-chart { max-width: 100%; }
.op-frontend .op-pm-pens { display: flex; flex-wrap: wrap; gap: 6px; }
.op-frontend .op-pm-pen {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    padding: 3px 12px 3px 8px;
    border: 1px solid var(--op-border-strong);
    border-radius: 999px;
    background: var(--op-surface);
    color: var(--op-text);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.op-frontend .op-pm-pen[hidden] { display: none; }
.op-frontend .op-pm-pen:hover { border-color: var(--op-primary); }
.op-frontend .op-pm-pen.is-active {
    border-color: var(--op-primary);
    box-shadow: inset 0 0 0 1px var(--op-primary);
    background: var(--op-primary-light);
    font-weight: 700;
}
.op-frontend .op-pm-pen:focus-visible { outline: 2px solid var(--op-primary); outline-offset: 2px; }
.op-frontend .op-pm-pen-count:not(:empty) {
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--op-text);
    color: var(--op-surface);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.op-frontend .op-pm-hint { margin: 0; }
@media (pointer: coarse) {
    .op-frontend .op-pm-pen { min-height: 44px; padding-inline: 10px 14px; }
}

/* The marks, as he dictated them. A tooth carrying none is drawn as on every chart. */
.op-frontend .op-pm-marks > * { display: none; }
.op-frontend .pm-debond .op-pm-debond,
.op-frontend .pm-band .op-pm-band,
.op-frontend .pm-whitespot .op-pm-white,
.op-frontend .pm-caries .op-pm-caries,
.op-frontend .pm-own-1 .op-pm-own-1,
.op-frontend .pm-own-2 .op-pm-own-2,
.op-frontend .pm-own-3 .op-pm-own-3 { display: inline; }
/* Debonded: a clear red bracket on the crown — the only red on this chart. */
.op-frontend .op-pm-debond { fill: var(--op-mark-debond); stroke: var(--op-surface); stroke-width: 1.4; }
.op-frontend .op-pm-band { fill: var(--op-mark-band); }
/* White spot: white, its thin dark outline is what shows it on a pale crown. */
.op-frontend .op-pm-white { fill: var(--op-mark-whitespot); stroke: var(--op-mark-caries); stroke-width: 1.1; }
.op-frontend .op-pm-caries { fill: var(--op-mark-caries); }
.op-frontend .op-pm-own { stroke: var(--op-surface); stroke-width: .8; }
.op-frontend .op-pm-own-1 { fill: var(--op-mark-own-1); }
.op-frontend .op-pm-own-2 { fill: var(--op-mark-own-2); }
.op-frontend .op-pm-own-3 { fill: var(--op-mark-own-3); }
/* Mobility: the whole tooth, crown and root. */
.op-frontend .pm-mobility .op-tc-crown,
.op-frontend .pm-mobility .op-tc-root {
    fill: color-mix(in srgb, var(--op-mark-mobility) 26%, var(--op-surface));
    stroke: var(--op-mark-mobility);
    stroke-width: 2.4;
}
/* Root resorption: the root only, the crown untouched. */
.op-frontend .pm-resorption .op-tc-root { fill: var(--op-mark-resorption); stroke: var(--op-mark-resorption); }
.op-frontend .op-pm-chart .op-tc-tooth.has-pm .op-tc-num { color: var(--op-text); font-weight: 700; }
.op-frontend .op-pm-chart .op-tc-tooth:not(:disabled):hover .op-tc-crown { fill: var(--op-primary-light); }
.op-frontend .op-pm-chart .op-tc-tooth.pm-mobility:not(:disabled):hover .op-tc-crown { fill: color-mix(in srgb, var(--op-mark-mobility) 26%, var(--op-surface)); }

/* The small tooth that names a mark: on the pen, in the legend, the readout, the card. */
.op-frontend .op-pm-sym { display: inline-block; flex: none; width: 18px; height: 29px; vertical-align: middle; }
.op-frontend .op-pm-sym svg { display: block; width: 100%; height: 100%; overflow: hidden; }
.op-frontend .op-pm-sym.is-out { opacity: .35; }
.op-frontend .op-pm-sym.is-out .op-tc-crown,
.op-frontend .op-pm-sym.is-out .op-tc-root { fill: var(--op-surface); stroke: var(--op-mark-extracted); stroke-dasharray: 3 2; }

.op-frontend .op-pm-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--op-text-muted); }
.op-frontend .op-pm-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.op-frontend .op-pm-legend-item[hidden] { display: none; }
.op-frontend .op-pm-legend-out { font-style: italic; }
.op-frontend .op-pm-readout { display: grid; gap: 4px; font-size: 13px; }
.op-frontend .op-pm-readout:empty { display: none; }
.op-frontend .op-pm-line { display: flex; align-items: center; gap: 8px; overflow-wrap: anywhere; }
.op-frontend .op-pm-line .op-pm-sym { width: 15px; height: 24px; }

/* ---- The card: a tooth problem with its mark (R11-FUP-08) ---- */
.op-frontend .op-visit-rec-item.has-mark { display: inline-flex; align-items: center; gap: 6px; }
.op-frontend .op-visit-rec-item.has-mark .op-pm-sym { width: 13px; height: 21px; }

/* ---- Problems from earlier visits, asked again (R11-FUP-12) ---- */
.op-frontend .op-visit-problems { border-color: var(--op-border-strong); background: var(--op-surface); color: var(--op-text); }
.op-frontend .op-visit-problems .op-pending-text { display: flex; align-items: center; gap: 8px; }
.op-frontend .op-visit-problems .op-pending-text .op-pm-sym { width: 15px; height: 24px; }
/* Calm: the line is the question, and from a tablet up its answers sit
   beside it — one row a problem (the teeth to tick under the answers when
   it has two or more). A phone stacks them. */
@media (min-width: 641px) {
    .op-frontend .op-visit-problems .op-problem-item { grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: var(--op-sp-4, 16px); }
    .op-frontend .op-visit-problems .op-problem-item .op-pending-text { min-height: 32px; }   /* level with the answers */
    .op-frontend .op-visit-problems .op-problem-item .op-pending-ask { justify-items: end; }
    .op-frontend .op-visit-problems .op-problem-item .op-pending-teeth { justify-self: stretch; }
}

/* fix/fup (R11-FUP-05/10): the two boxes follow what he types (dir="auto"),
   but an empty one shows its hint in the page's direction — the Arabic
   "مثلاً Anchorage loss: …" was laid out left to right, from the left edge. */
.op-frontend .op-visit-form textarea[dir="auto"]:placeholder-shown { direction: inherit; }
.op-frontend .op-followup-problems-title { margin-top: var(--op-sp-2, 8px); }
.op-frontend .op-problem-lines .op-pending-line { color: var(--op-text); }
.op-frontend .op-followup-pending .op-followup-problems-title:first-child { margin-top: 0; }

/* ---- A phone and a tablet: one column, nothing wider than the card (R11-MOB-03) ---- */
.op-frontend .op-visit-form,
.op-frontend .op-visit-form .op-visit-sec,
.op-frontend .op-visit-form .op-visit-subsec { min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
    /* Two answers side by side ("Yes / Not yet", "Resolved / Not yet"): the
       phone's class break would put each on a line of its own. */
    .op-frontend .op-pending-ask .op-chip-rule { display: none; }
    .op-frontend .op-pm-pen { font-size: 12.5px; }
    .op-frontend .op-plan-steps { grid-template-columns: minmax(0, 1fr); }
}

/* ==========================================================================
   fix/fup18 (17 Nov 2026) — the Follow-up step after the call
   ========================================================================== */

/* C17-FUP-14: "Problems" beside "+ Add visit", and the list it opens. */
.op-frontend .op-followup-head-acts { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--op-sp-2, 8px); }
.op-frontend .op-case-problems-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.op-frontend .op-case-problems-btn.is-active { background: var(--op-bg-alt); }
.op-frontend .op-case-problems-n { margin-inline-start: 2px; }
.op-frontend .op-case-problems {
    margin: 0 0 var(--op-sp-4, 16px); padding: var(--op-sp-3, 12px) var(--op-sp-4, 16px);
    border: 1px solid var(--op-border); border-radius: var(--op-radius-md, 10px); background: var(--op-surface);
}
.op-frontend .op-case-problems[hidden] { display: none; }
.op-frontend .op-case-problems-title { margin: 0 0 2px; font-size: 15px; font-weight: 700; color: var(--op-text); }
.op-frontend .op-case-problems > .op-field-hint { margin: 0 0 var(--op-sp-2, 8px); }
.op-frontend .op-prob-group-title { margin: var(--op-sp-3, 12px) 0 var(--op-sp-1, 4px); font-size: 13px; font-weight: 700; color: var(--op-text); }
.op-frontend .op-prob-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.op-frontend .op-prob-row {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px var(--op-sp-3, 12px); align-items: center;
    padding: 8px 10px; border: 1px solid var(--op-border); border-inline-start-width: 4px; border-radius: var(--op-radius-sm, 8px);
}
.op-frontend .op-prob-row.is-open { border-inline-start-color: var(--op-danger); }
.op-frontend .op-prob-row.is-resolved { border-inline-start-color: var(--op-success); }
.op-frontend .op-prob-what { grid-column: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; color: var(--op-text); }
.op-frontend .op-prob-what .op-pm-sym { width: 15px; height: 24px; margin-inline-end: 6px; vertical-align: middle; }
.op-frontend .op-prob-when { grid-column: 1; font-size: 12.5px; color: var(--op-text-muted); }
.op-frontend .op-prob-state { grid-column: 2; grid-row: 1 / span 2; justify-self: end; white-space: normal; text-align: center; }
@media (max-width: 640px) {
    .op-frontend .op-prob-row { grid-template-columns: minmax(0, 1fr); }
    .op-frontend .op-prob-state { grid-column: 1; grid-row: auto; justify-self: start; }
}

/* C17-FUP-05/06: the form's title with its number, and Close at the top. */
.op-frontend .op-visit-form-head { display: flex; align-items: center; justify-content: space-between; gap: var(--op-sp-2, 8px); margin: 0 0 var(--op-sp-3, 12px); }
.op-frontend .op-visit-form-head .op-visit-form-title { margin: 0; min-width: 0; }
.op-frontend .op-visit-form-sep { color: var(--op-text-muted); }
.op-frontend .op-visit-form-no {
    display: inline-block; padding: 1px 10px; border-radius: 999px; white-space: nowrap;
    background: var(--op-primary-light); color: var(--op-primary-dark); border: 1px solid var(--op-primary); font-weight: 800;
}
.op-frontend .op-visit-form-close { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 44px; min-width: 44px; }

/* C17-FUP-01: every pending item red; the late one labelled. */
/* The 3.0 banners (New look off); the calm look's one-line list is below. */
.op-frontend .op-case-alerts .op-case-alert.op-case-alert-pending.is-pending { border-color: var(--op-danger); background: var(--op-danger-bg); color: var(--op-danger-text); }
.op-frontend .op-pending-late { margin-inline-start: 6px; vertical-align: 1px; white-space: nowrap; }
.op-frontend .op-pending-line.is-pending { color: var(--op-danger-text); }
/* fix/fup18 review: the visit's to-do too — every pending item of the plan in red words, not only the late one (its badge the one difference). */
.op-frontend .op-todo-row:not(.is-done):not(.op-problem-item) .op-pending-text { color: var(--op-danger-text); }

/* C17-FUP-11 / -14: what a visit did or resolved reads green — "Done at Follow-up 7", "Resolved at Follow-up 20 (date)". */
.op-frontend .op-badge.is-success { background: var(--op-success-bg); color: var(--op-success-text); }

/* C17-FUP-11: done at a later visit — said, not asked again. */
.op-frontend .op-pending-done-later { margin: 0; }
.op-frontend .op-pending-item.is-done-later .op-pending-text { color: var(--op-text-muted); }

/* C17-FUP-07: when each appliance was fitted, beside its name (its own box: a terminated row strikes the name, not the date). */
.op-frontend .op-wear-fitted { display: inline-block; text-decoration: none; font-weight: 400; font-size: 12.5px; color: var(--op-text-muted); }

/* C17-FUP-15: the retention tick, at hand at the end of the form. */
.op-frontend .op-visit-retention { margin-top: var(--op-sp-3, 12px); }
.op-frontend .op-visit-retention[hidden] { display: none; }
.op-frontend .op-visit-retention .op-visit-sec-title { margin: 0 0 var(--op-sp-2, 8px); }
.op-frontend .op-retention-tile { max-width: 100%; }

/* ---- the calm look: each section and each card group its own colour (C17-FUP-03/04) ----
   «كله المربعات بيضة وشبه بعض … انا تايه». The pillars' way (fix/look16): a
   wash behind the section, its title on a band of the stronger tint right
   across its top, its colour round every side (1 px, 4 px on the
   inline-start side). The tokens and their role are in op-zz-design.css
   (section 0, fix/fup18); a hint inside is ink-2, as in a pillar block. */
.op-ds .op-visit-form [data-visit-sec] {
    --sec: var(--ds-n-400); --sec-tint: var(--ds-n-100); --sec-wash: var(--ds-n-50);
    --ds-ink-3: var(--ds-ink-2); --op-text-soft: var(--ds-ink-2);
    background: var(--sec-wash);
    border: 1px solid var(--sec); border-inline-start: 4px solid var(--sec); border-radius: var(--ds-r-lg);
    padding: 0 var(--ds-sp-4) var(--ds-sp-4); margin: 0 0 var(--ds-sp-4);
}
.op-ds .op-visit-form [data-visit-sec="plan"] { --sec: var(--ds-sec-plan); --sec-tint: var(--ds-sec-plan-tint); --sec-wash: var(--ds-sec-plan-wash); }
.op-ds .op-visit-form [data-visit-sec="comp"] { --sec: var(--ds-sec-comp); --sec-tint: var(--ds-sec-comp-tint); --sec-wash: var(--ds-sec-comp-wash); }
.op-ds .op-visit-form [data-visit-sec="proc"] { --sec: var(--ds-sec-proc); --sec-tint: var(--ds-sec-proc-tint); --sec-wash: var(--ds-sec-proc-wash); }
.op-ds .op-visit-form [data-visit-sec="mech"] { --sec: var(--ds-sec-mech); --sec-tint: var(--ds-sec-mech-tint); --sec-wash: var(--ds-sec-mech-wash); }
.op-ds .op-visit-form [data-visit-sec="prob"] { --sec: var(--ds-sec-prob); --sec-tint: var(--ds-sec-prob-tint); --sec-wash: var(--ds-sec-prob-wash); }
.op-ds .op-visit-form [data-visit-sec="next"] { --sec: var(--ds-sec-next); --sec-tint: var(--ds-sec-next-tint); --sec-wash: var(--ds-sec-next-wash); }
.op-ds .op-visit-form [data-visit-sec][hidden] { display: none; }
/* The band: the section's whole top, edge to edge, its title in ink. */
.op-ds .op-visit-form [data-visit-sec] > :is(summary, .op-visit-sec-title):first-child {
    background: var(--sec-tint); color: var(--ds-ink);
    margin: 0 calc(-1 * var(--ds-sp-4)) var(--ds-sp-3); padding: 10px var(--ds-sp-4); min-height: 44px; box-sizing: border-box;
    border-radius: calc(var(--ds-r-lg) - 1px) calc(var(--ds-r-lg) - 1px) 0 0; border: 0;
}
/* The plan's count keeps its amber (green once all ticked) on a white pill: on the band's tint it read at 4.2:1. */
.op-ds .op-visit-form [data-visit-sec] > :is(summary, .op-visit-sec-title):first-child .op-plan-count {
    background: var(--ds-surface); border-radius: var(--ds-r-full); padding: 0 var(--ds-sp-2);
}
/* Folded, the section is its band (:first-child: as strong as the band's own rule above, or its 12 px under the title stayed). */
.op-ds .op-visit-form details[data-visit-sec]:not([open]) { padding-bottom: 0; }
.op-ds .op-visit-form details[data-visit-sec]:not([open]) > summary:first-child { margin-bottom: 0; border-radius: calc(var(--ds-r-lg) - 1px); }
.op-ds .op-visit-form .op-visit-retention > .op-visit-sec-title { display: flex; align-items: center; font: 600 var(--ds-l1b-fs, 16px)/var(--ds-l1b-lh, 24px) var(--ds-font); }
.op-ds .op-visit-form [data-visit-sec] .op-plan-strategy { background: var(--ds-surface); }
@media (max-width: 640px) {
    /* A phone: 12 px at the end, and at the start the room a field label's bar hangs in (--ds-label-room). */
    .op-ds .op-visit-form [data-visit-sec] { padding: 0 var(--ds-sp-3) var(--ds-sp-3); padding-inline-start: var(--ds-label-room); }
    .op-ds .op-visit-form [data-visit-sec] > :is(summary, .op-visit-sec-title):first-child {
        margin-inline-start: calc(-1 * var(--ds-label-room)); margin-inline-end: calc(-1 * var(--ds-sp-3));
        padding-inline-start: var(--ds-label-room); padding-inline-end: var(--ds-sp-3);
    }
    /* A tooth chart and the board keep the section's whole width, edge to edge over its outline: a whole arch of
       16 teeth needs every pixel of a phone (each 15 px wide, 44 px tall). */
    .op-ds .op-visit-form [data-visit-sec] :is(.op-toothchart, .op-mech):not(.op-mech .op-toothchart) {
        margin-inline-start: calc(-1 * var(--ds-label-room) - 4px); margin-inline-end: calc(-1 * var(--ds-sp-3) - 1px);
        max-width: none;   /* the problems chart is capped at 100 % of the section's content */
    }
}

/* The visit card: each group of lines its own tinted block — done green, still
   pending amber, problems red, the form's section colours for the rest. */
.op-ds .op-visit-record > .op-visit-field {
    --grp: var(--ds-n-400); --grp-wash: var(--ds-n-50);
    --ds-ink-3: var(--ds-ink-2); --op-text-soft: var(--ds-ink-2);
    background: var(--grp-wash); border-inline-start: 4px solid var(--grp); border-radius: var(--ds-r-md);
    padding: var(--ds-sp-2) var(--ds-sp-3);
}
.op-ds .op-visit-record > :is(.op-visit-rec-planned, .op-visit-rec-pendingdone, .op-visit-rec-resolved, .op-visit-rec-laterdone) { --grp: var(--ds-success); --grp-wash: var(--ds-success-wash); }
.op-ds .op-visit-record > :is(.op-visit-rec-pending, .op-visit-rec-later) { --grp: var(--ds-warning); --grp-wash: var(--ds-warning-wash); }
.op-ds .op-visit-record > :is(.op-visit-rec-followups, .op-visit-rec-problems) { --grp: var(--ds-danger); --grp-wash: var(--ds-danger-wash); }
.op-ds .op-visit-record > .op-visit-rec-payment { --grp: var(--ds-sec-plan); --grp-wash: var(--ds-sec-plan-wash); }
.op-ds .op-visit-record > .op-visit-rec-compliance { --grp: var(--ds-sec-comp); --grp-wash: var(--ds-sec-comp-wash); }
.op-ds .op-visit-record > :is(.op-visit-rec-wires, .op-visit-rec-auxiliaries, .op-visit-rec-brackets) { --grp: var(--ds-sec-proc); --grp-wash: var(--ds-sec-proc-wash); }
.op-ds .op-visit-record > :is(.op-visit-rec-mechanics, .op-visit-rec-actions_done) { --grp: var(--ds-sec-mech); --grp-wash: var(--ds-sec-mech-wash); }
.op-ds .op-visit-record > .op-visit-rec-clinical_findings { --grp: var(--ds-sec-prob); --grp-wash: var(--ds-sec-prob-wash); }
.op-ds .op-visit-record > .op-visit-rec-next_visit_strategy { --grp: var(--ds-sec-next); --grp-wash: var(--ds-sec-next-wash); }
.op-ds .op-visit-record .op-visit-field-label { color: var(--ds-ink); font-weight: 600; }

/* The calm look of the rest. */
.op-ds .op-case-problems { border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); background: var(--ds-surface); }
.op-ds .op-case-problems-title { font: 600 var(--ds-l1b-fs, 16px)/var(--ds-l1b-lh, 24px) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-prob-group-title { font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-prob-row { border: 1px solid var(--ds-line); border-inline-start: 4px solid var(--ds-n-400); border-radius: var(--ds-r-md); background: var(--ds-surface); }
.op-ds .op-prob-row.is-open { border-inline-start-color: var(--ds-danger); }
.op-ds .op-prob-row.is-resolved { border-inline-start-color: var(--ds-success); }
.op-ds .op-prob-what { font: 500 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-prob-when { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
/* The green badge (done, resolved): the success tint and its dot, as the red one has its own. */
.op-ds .op-badge.is-success { background: var(--ds-success-bg); color: var(--ds-success-text); --dot: var(--ds-success); }
.op-ds .op-badge.is-success::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--dot); }
/* The title's own 16 px under it (op-zz-design.css, #op-visit-form-title) goes to its row, so Close sits level with it. */
.op-ds .op-visit-form-head { margin: 0 0 var(--ds-sp-4); }
.op-ds .op-visit-form-head #op-visit-form-title { margin: 0; }
.op-ds .op-visit-form-no { background: var(--ds-brand-50); color: var(--ds-brand-700); border-color: var(--ds-brand-100); font-weight: 600; }
.op-ds .op-visit-form-sep { color: var(--ds-ink-2); }
.op-ds .op-pending-line.is-pending { color: var(--ds-ink); }
.op-ds .op-pending-line.is-pending::before { background: var(--ds-danger); }
/*
 * fix/fup18 review (C17-FUP-01): «الاتنين اللي تحتهم … كأنهم حاجة عادية».
 * Every pending item in red words wherever it is listed, as in the case's
 * notices: the Follow-up header, the visit's to-do (the late one keeps its
 * badge as the one difference) and the My cases badge (the danger tint
 * behind its words, the follow-up's own badges only).
 */
.op-ds .op-followup-pending .op-pending-line.is-pending { color: var(--ds-danger-text); }
.op-ds .op-todo .op-todo-row:not(.is-done):not(.op-problem-item) .op-pending-text { color: var(--ds-danger-text); }
.op-ds .op-case-badges .op-case-badge.op-case-badge-pending.is-overdue { background: var(--ds-danger-bg); color: var(--ds-danger-text); }
.op-ds .op-case-badges .op-case-badge.op-case-badge-pending.is-overdue .op-case-badge-teeth { color: var(--ds-danger-text); }
.op-ds .op-case-notices .op-case-alert-pending.is-pending { color: var(--ds-danger-text); }
.op-ds .op-case-notices .op-case-alert-pending.is-pending::before { background: var(--ds-danger); }
.op-ds .op-wear-fitted { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
/* ---- end fix/fup18 ---- */

/* ---- fix/vsum18 (W18-04): a visit's Summary, the whole visit in one panel ----
 * A dialog over the page from 768 px (the doctor's tablet in portrait and his
 * computer), a sheet from the foot of the screen below it. The head (the
 * visit, its date and phase, ×) and the foot (Print / Download, Close) stay
 * put; only the visit's parts scroll. The page under it does not move
 * (op-vsum-lock), so Close leaves him where he was. */
html.op-vsum-lock, html.op-vsum-lock body { overflow: hidden; }
.op-frontend .op-vsum .op-modal-content.op-vsum-panel {
    display: flex; flex-direction: column; width: 100%; max-width: 720px; max-height: min(88vh, 960px);
    padding: 0; overflow: hidden; outline: none;
}
.op-frontend .op-vsum-head {
    flex: none; display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 12px 12px 20px; border-bottom: 1px solid var(--op-border);
}
[dir="rtl"] .op-frontend .op-vsum-head { padding: 16px 20px 12px 12px; }
.op-frontend .op-vsum-heading { flex: 1 1 auto; min-width: 0; }
.op-frontend .op-vsum .op-vsum-title { margin: 0; font-size: 18px; line-height: 1.35; overflow-wrap: anywhere; }
.op-frontend .op-vsum-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; margin: 2px 0 0; font-size: 13px; color: var(--op-text-muted); }
.op-frontend .op-vsum-x {
    flex: none; width: 44px; height: 44px; margin-block-start: -8px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: var(--op-radius); background: none; color: var(--op-text-muted); font-size: 22px; cursor: pointer;
}
.op-frontend .op-vsum-x:hover { background: var(--op-bg-alt); color: var(--op-text); }
.op-frontend .op-vsum-body {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
    display: grid; gap: 8px; align-content: start; padding: 12px 20px 16px;
}
.op-frontend .op-vsum-body .op-visit-record { margin: 0; }
.op-frontend .op-vsum-sec { padding: 8px 12px; border: 1px solid var(--op-border); border-radius: var(--op-radius-sm, 8px); }
.op-frontend .op-vsum-sec-title {
    margin: 0 0 4px; padding: 0 0 4px; border-bottom: 1px solid var(--op-border);
    font-size: 13px; font-weight: 700; color: var(--op-text);
}
.op-frontend .op-vsum-items { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.op-frontend .op-vsum-items li { padding: 1px 0; }
.op-frontend .op-vsum-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.op-frontend .op-vsum-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.op-frontend .op-vsum-thumb { margin: 0; min-width: 0; }
.op-frontend .op-vsum-thumb .op-lightbox-trigger { display: block; min-height: 44px; border-radius: var(--op-radius-sm, 8px); overflow: hidden; }
.op-frontend .op-vsum-thumb img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.op-frontend .op-vsum-thumb figcaption { margin-top: 2px; font-size: 12px; color: var(--op-text-muted); overflow-wrap: anywhere; }
.op-frontend .op-vsum-voice .op-voice-onvisit { margin: 0; }
.op-frontend .op-vsum-foot {
    flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px;
    padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--op-border);
}
.op-frontend .op-vsum-foot .op-btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
/* The sheet: from the foot of a phone, full width, its grab line. */
@media (max-width: 767px) {
    .op-frontend .op-modal.op-vsum { align-items: flex-end; padding: 0; }
    .op-frontend .op-vsum .op-modal-content.op-vsum-panel {
        max-width: none; max-height: 90vh; border-radius: var(--op-radius-lg) var(--op-radius-lg) 0 0;
        animation: opVsumUp 200ms ease-out;
    }
    .op-frontend .op-vsum-head { position: relative; padding-top: 20px; }
    .op-frontend .op-vsum-head::before {
        content: ''; position: absolute; top: 7px; left: 50%; width: 36px; height: 4px; margin-left: -18px;
        border-radius: 2px; background: var(--op-border-strong);
    }
    .op-frontend .op-vsum-body { padding: 10px 16px 14px; }
    .op-frontend .op-vsum-foot { padding-inline: 16px; }
    .op-frontend .op-vsum-foot .op-btn { flex: 1 1 140px; }
}
@keyframes opVsumUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .op-frontend .op-vsum .op-modal-content.op-vsum-panel { animation: none; } }
/* The New look: its tokens. */
.op-ds .op-vsum .op-modal-content.op-vsum-panel { padding: 0; }
.op-ds .op-vsum-head, .op-ds .op-vsum-foot { border-color: var(--ds-line); }
.op-ds .op-vsum .op-vsum-title { font: 600 var(--ds-fs-lg)/var(--ds-lh-lg) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-vsum-meta { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-vsum-x { color: var(--ds-icon); border-radius: var(--ds-r-md); }
.op-ds .op-vsum-x:hover { background: var(--ds-sunken); color: var(--ds-ink); }
.op-ds .op-vsum-x .op-ic { width: 20px; height: 20px; }
.op-ds .op-vsum-sec { border-color: var(--ds-line); border-radius: var(--ds-r-md); background: var(--ds-surface); }
.op-ds .op-vsum-sec-title { border-bottom-color: var(--ds-line); font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-vsum-items { font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-vsum-thumb figcaption { font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); }
@media (max-width: 767px) {
    .op-ds .op-vsum .op-modal-content.op-vsum-panel { border-radius: var(--ds-r-lg) var(--ds-r-lg) 0 0; }
    .op-ds .op-vsum-head::before { background: var(--ds-line-strong); }
}
/* Its parts: the instructions handed, the photos, the next appointment; the phase beside the date. */
.op-frontend .op-vsum-instr .op-vsum-items li,
.op-frontend .op-vsum-next .op-vsum-items li { overflow-wrap: anywhere; }
.op-frontend .op-vsum-photos .op-vsum-thumbs { margin-top: 4px; }
.op-frontend .op-vsum-phase { white-space: nowrap; }
.op-frontend .op-vsum-print { text-decoration: none; }
.op-frontend .op-vsum-done { min-width: 96px; }
/* The header's buttons: Summary sits between Photos and Edit, the same size. */
.op-frontend .op-visit-summary-open { white-space: nowrap; }
/* With Summary on it, the card's row of buttons wraps (as with "Download instructions"), so a phone keeps it on the screen. */
.op-frontend .op-visit-meta:has(.op-visit-summary-open) { flex-wrap: wrap; justify-content: flex-end; row-gap: 6px; }
/* On a phone in the New look the buttons start their rows, as with "Download instructions" (op-zz-mobile.css). */
@media (max-width: 640px) {
    .op-ds .op-visit-meta:has(.op-visit-summary-open) { justify-content: flex-start; }
}
/* New look off: a board line's joining words read as in 3.0.0. */
.op-frontend .op-visit-rec-sep { white-space: pre; }
.op-frontend .op-visit-rec-item.has-parts .op-visit-rec-tool { font-weight: 600; }
/* ---- end fix/vsum18 ---- */

/* ======================================================================
 * fix/fup24 (24 Nov 2026) — the Follow-up round. Calm tokens only (--ds-*),
 * no new hue: "Next visit" is the calm look's warning amber.
 * ====================================================================== */

/* M24-22: the new visit, landed on after its save. */
.op-frontend .op-visit-card.is-landed { scroll-margin-top: 96px; }

/* M24-27: "For the next visit", one compact line an item, three small choices inline, a soft tint. */
.op-frontend .op-later-fold > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 32px; }
.op-frontend .op-later-fold > summary::-webkit-details-marker { display: none; }
.op-frontend .op-later-more { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.op-frontend .op-later-fold[open] .op-later-more { display: none; }
.op-frontend .op-later-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.op-frontend .op-later-block .op-later-row,
.op-frontend .op-later-line {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
    margin: 0; padding: 4px 8px; border-radius: var(--ds-r-md, 6px);
    background: var(--ds-warning-bg, #fbf3e5); border: 0; box-shadow: none;
}
.op-frontend .op-later-block .op-later-row .op-pending-text,
.op-frontend .op-later-line > bdi { flex: 1 1 16em; min-width: 0; margin: 0; font-size: var(--ds-fs-sm, 13px); line-height: var(--ds-lh-sm, 18px); }
.op-frontend .op-later-block .op-later-ask { margin: 0; }
.op-frontend .op-later-block .op-later-ask .op-field-label { display: none; }
.op-frontend .op-later-block .op-later-ask .op-chips { gap: 4px; flex-wrap: nowrap; }
.op-frontend .op-later-block .op-later-ask .op-chip-rule { display: none; }
.op-frontend .op-later-block .op-later-ask .op-chip,
.op-frontend .op-later-act {
    min-height: 32px; padding: 0 10px; border-radius: var(--ds-r-md, 6px);
    border: 1px solid var(--ds-line-strong, #c9d1d6); background: var(--ds-surface, #fff);
    font: 500 var(--ds-fs-xs, 12px)/1 var(--ds-font, inherit); color: var(--ds-ink, #131d23); cursor: pointer;
}
.op-frontend .op-later-acts { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.op-frontend .op-later-act:hover { background: var(--ds-sunken, #eceff1); }
.op-frontend .op-later-block .op-chip.is-active.op-chip-success { background: var(--ds-success-bg, #ecf5f0); border-color: var(--ds-success, #3a8a62); color: var(--ds-success-text, #276b4b); }
.op-frontend .op-later-block .op-chip.is-active.op-chip-warning { background: var(--ds-warning-bg, #fbf3e5); border-color: var(--ds-warning, #c27f22); color: var(--ds-warning-text, #86570f); }
.op-frontend .op-later-block .op-chip.is-active:not(.op-chip-success):not(.op-chip-warning) { background: var(--ds-sunken, #eceff1); border-color: var(--ds-ink-2, #4a5761); color: var(--ds-ink, #131d23); }
.op-frontend .op-later-row.is-cancelled .op-pending-text bdi { text-decoration: line-through; color: var(--ds-ink-2, #4a5761); }
.op-frontend .op-later-block .op-todo-mark { display: none; }
@media (pointer: coarse) {
    .op-frontend .op-later-block .op-later-ask .op-chip,
    .op-frontend .op-later-act { min-height: 44px; min-width: 44px; }
}
@media (max-width: 480px) {
    .op-frontend .op-later-block .op-later-ask .op-chips { flex-wrap: wrap; }
}

/* M24-28: a kept item in amber, whole, with its "Next visit" tag; the legend under the chart. */
.op-frontend .op-visit-form .op-mech-later-layer.is-amber { opacity: 1; }
.op-frontend .op-visit-form .op-mech-later-layer.is-amber line,
.op-frontend .op-visit-form .op-mech-later-layer.is-amber path { stroke-dasharray: none; }
/* A kept TAD or hook: a solid amber ring on a soft amber disc, not a thin dashed circle; the palatal view's spot the same. */
.op-frontend .op-visit-form .op-mech-later-layer.is-amber .op-mech-later-ring { stroke-dasharray: none; stroke-width: 2.6; fill: var(--ds-warning-bg, #fbf3e5); fill-opacity: .85; }
.op-frontend .op-visit-form .op-mech-pspot.is-later .op-mech-spot-ring { stroke: var(--ds-warning, #c27f22); stroke-dasharray: none; stroke-width: 2.6; fill: var(--ds-warning-bg, #fbf3e5); }
.op-frontend .op-visit-form .op-mech-later-tag { fill: var(--ds-warning-text, #86570f); font-size: 9.5px; }
.op-frontend .op-visit-form .op-mech-later[aria-pressed="true"] { border-color: var(--ds-warning, #c27f22); background: var(--ds-warning-bg, #fbf3e5); color: var(--ds-warning-text, #86570f); }
.op-frontend .op-visit-form .op-tc-tooth.is-later { outline: 2px solid var(--ds-warning, #c27f22); outline-offset: -2px; }
.op-frontend .op-visit-form .op-check-tile.is-later { border-color: var(--ds-warning, #c27f22); background: var(--ds-warning-bg, #fbf3e5); }
.op-frontend .op-later-legend { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; }
.op-frontend .op-later-legend[hidden] { display: none; }
.op-frontend .op-later-swatch { flex: 0 0 auto; width: 18px; height: 4px; border-radius: 2px; background: var(--ds-warning, #c27f22); }

/* M24-25: "Next visit strategy" — the charts in planning mode. */
.op-frontend .op-plan-next-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 4px 0 10px; }
.op-frontend .op-plan-next-bar.is-strategy { margin-top: 8px; }
.op-frontend .op-plan-next { display: inline-flex; align-items: center; gap: 6px; }
.op-frontend .op-plan-next[aria-pressed="true"] { border-color: var(--ds-warning, #c27f22); background: var(--ds-warning-bg, #fbf3e5); color: var(--ds-warning-text, #86570f); }
.op-frontend .op-plan-next-hint { flex: 1 1 18em; min-width: 0; }
.op-frontend .op-visit-form.is-planning-next .op-plan-next-hint { color: var(--ds-warning-text, #86570f); }
.op-frontend .op-visit-form.is-planning-next [data-visit-sec="proc"] { box-shadow: inset 3px 0 0 var(--ds-warning, #c27f22); }
.op-frontend .op-later-echo { margin: 6px 0 0; }
.op-frontend .op-later-echo[hidden] { display: none; }
.op-frontend .op-later-echo-list { margin: 2px 0 0; padding-inline-start: 1.2em; }
.op-frontend .op-later-echo-list li { margin: 1px 0; }
.op-frontend .op-later-wire { margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.op-frontend .op-later-wire[hidden] { display: none; }
.op-frontend .op-later-wire-item { display: inline-flex; align-items: center; gap: 6px; padding: 2px 4px 2px 8px; border-radius: var(--ds-r-md, 6px); background: var(--ds-warning-bg, #fbf3e5); color: var(--ds-warning-text, #86570f); font-size: var(--ds-fs-sm, 13px); }
/* M24-26: a wire an earlier visit planned, carried to today: amber line, its alloy chip ringed, Done now beside it. */
.op-frontend .op-later-wire-item.is-carried { flex-wrap: wrap; border-inline-start: 3px solid var(--ds-warning, #c27f22); }
.op-frontend .op-later-wire-tag { font-weight: 600; }
.op-frontend .op-later-wire-now { min-height: 44px; }
.op-frontend .op-visit-wire-chipfield .op-chip.is-later-planned,
.op-ds .op-visit-wire-chipfield .op-chip.is-later-planned:not(.is-active) { border-color: var(--ds-warning, #c27f22) !important; box-shadow: inset 0 0 0 1px var(--ds-warning, #c27f22); background: var(--ds-warning-bg, #fbf3e5) !important; }

/* M24-24: the visit's archwires as Clinical Steps' card — the wire's chips with the Size beside them. */
.op-frontend .op-visit-wire-steps { margin: 0 0 10px; }
.op-frontend .op-visit-wire-steps .op-visit-arch-label { margin: 6px 0 4px; }
.op-frontend .op-visit-wire-row { align-items: end; }
.op-frontend .op-visit-wire-pick { min-width: 0; }
.op-frontend .op-visit-wire-chipfield .op-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.op-frontend .op-visit-wire-sizebox { min-width: 0; }
@media (max-width: 520px) {
    .op-frontend .op-visit-wire-row { grid-template-columns: 1fr; }
}

/* M24-30: "Not mentioned again", a small group of its own below Resolved. */
.op-frontend .op-prob-list[data-prob-group="quiet"] .op-prob-row { opacity: .85; }
.op-frontend .op-prob-row.is-dropped .op-prob-state { background: var(--ds-sunken, #eceff1); color: var(--ds-ink-2, #4a5761); }

/* M24-31: "Pending from the plan: Nothing pending", quiet. */
.op-frontend .op-visit-rec-item.is-quiet { color: var(--ds-ink-2, #4a5761); }

/* M24-32: the visit's photos — a clean layer above the page that scrolls on its own; a progress per photo. */
html.op-vphoto-lock, html.op-vphoto-lock body { overflow: hidden; }
.op-frontend .op-modal.op-visit-photos { z-index: 100000; overscroll-behavior: contain; }
.op-frontend .op-visit-photos .op-modal-content { max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.op-frontend .op-visit-photos-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; position: sticky; bottom: -1px; padding-top: 8px; background: var(--ds-surface, #fff); }
.op-frontend .op-visit-photos-done { min-width: 96px; min-height: 44px; }
.op-frontend .op-visit-slot.is-uploading { pointer-events: none; }
.op-frontend .op-upload-progress { position: relative; display: block; height: 6px; border-radius: 3px; background: var(--ds-sunken, #eceff1); overflow: hidden; }
.op-frontend .op-upload-progress > span { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; background: var(--ds-brand, #136364); transition: width .2s linear; }
.op-frontend .op-upload-progress-n { font-size: var(--ds-fs-xs, 12px); color: var(--ds-ink-2, #4a5761); }
@media (max-width: 767px) {
    .op-frontend .op-modal.op-visit-photos { padding: 0; align-items: stretch; }
    .op-frontend .op-visit-photos .op-modal-content { max-height: 100vh; max-height: 100dvh; height: 100%; border-radius: 0; }
}
/* ---- end fix/fup24 ---- */

/* fix/fup24 (M24-27), New look: the kept items' rows calm and compact inside the to-do block and the header —
   a soft amber tint, no boxed card, no red; a block holding only them is no red panel either. */
.op-ds .op-todo .op-later-block .op-todo-row.op-later-row,
.op-ds .op-followup-pending .op-later-lines .op-later-line {
    padding: 4px 8px; padding-inline-start: 10px; gap: 4px 10px;
    background: var(--ds-warning-bg); border: 0; border-inline-start: 3px solid var(--ds-warning); border-radius: var(--ds-r-md);
}
.op-ds .op-todo .op-later-block .op-todo-row.op-later-row .op-pending-text,
.op-ds .op-followup-pending .op-later-line > bdi { color: var(--ds-ink); font-weight: 500; font-size: var(--ds-fs-sm); line-height: var(--ds-lh-sm); }
/* Review: no red bullet on a kept item — red reads as overdue; the amber edge says enough. */
.op-ds .op-followup-pending .op-later-lines .op-later-line::before { content: none; display: none; }
.op-ds .op-todo .op-later-block .op-todo-row.op-later-row.is-done { background: var(--ds-success-wash); border-inline-start-color: var(--ds-success); }
.op-ds .op-todo .op-later-block .op-todo-row.op-later-row.is-cancelled { background: var(--ds-sunken); border-inline-start-color: var(--ds-line-strong); }
.op-ds .op-todo .op-later-block .op-pending-list { gap: 4px; }
.op-ds :is(.op-todo, .op-followup-pending).is-later-only {
    background: var(--ds-surface); border-color: var(--ds-line); border-inline-start-color: var(--ds-warning);
}
.op-ds .op-todo.is-later-only .op-todo-title > .op-todo-icon { color: var(--ds-warning); }
.op-ds .op-later-fold > summary.op-visit-pending-title,
.op-ds .op-later-fold > summary.op-followup-pending-title { margin: 0 0 4px; }

/* fix/fup24 (M24-27): the reminder's heading, a tap to open or fold it, in the header and the form. */
.op-frontend .op-later-head { font-weight: 600; }
.op-frontend .op-later-head-fold { margin: 0; }
