/* ==========================================================================
   OrthoPlan Pro — the design layer: the CALM look (9 Nov 2026)
   --------------------------------------------------------------------------
   Mohamed, opening 3.0.0 on the live site: "I don't like the look and the
   colours. Something feels wrong. Everything is very crowded, the colours are
   strange, nothing is coordinated." Measured, he was right: about nine boxed
   chrome elements round every step, four two-line amber banners above the
   case, seven hue families on one step, 33 font sizes, 33 uppercase rules and
   about seventy emoji used as icons. This file replaces the 3.0 look with the
   one in docs/overhaul/calm/DESIGN-SPEC.md. Its five principles decide every
   case the spec does not name:

     1. Teal means "act" or "chosen", nothing else. Primary buttons are solid
        teal; the current or selected item is a teal tint; the rest is grey.
     2. Colour is a status, and status is small: dots, badge text, icons and
        1–2 px lines. It never fills a row, a card or a band.
     3. One box. Inside a section card nothing has a border but a control.
     4. Quiet type: sentence case, weights 400–600, six sizes.
     5. Chrome recedes: the case strip, the step rail, the context row and the
        bottom bar are lines, not cards.

   THE KILL SWITCH (unchanged). Every rule is scoped under `.op-ds`, the class
   OrthoPlan_Public::shell_classes() puts on a screen root while Settings ›
   General › "New look" is on. Off, not one rule here applies. The tokens on
   :root are inert until a `.op-ds` rule reads them.

   Load order (F2's loader goes in name order): public.css, the modules,
   op-zy-calm-base.css (GENERATED by tools/calm_base.py: the legacy sizes,
   capitals, weights and colour literals brought onto this scale), then this
   file, then op-zz-icons.css (the line icons).

   Specificity: `.op-ds .x` (0,2,0) ties public.css's `.op-frontend .x` and
   wins on order. `!important` only where public.css set it on the same
   property of the same element (the chips, buttons, tool buttons, step
   links, the form grid's columns, the tone chips).

   The registry is untouched (public.css :root, OrthoPlan_Teeth::palette()).
   Inside the tooth charts, the board and the static figures the clinical
   colours are the registry's own (section 0c).
   ========================================================================== */

/* ---- 0. Tokens (spec 3.1) ------------------------------------------------ */
:root {
    /* Neutrals: one cool grey family, in the hue of the logo teal. */
    --ds-n-0:   #ffffff;   /* surface: cards, bars, inputs                     */
    --ds-n-50:  #f4f6f7;   /* canvas; hover on white                           */
    --ds-n-100: #eceff1;   /* sunken: badge and count fill, hover on canvas    */
    --ds-n-200: #dfe4e7;   /* line: card border, dividers                      */
    --ds-n-300: #c9d1d6;   /* strong line: chip and secondary button border    */
    --ds-n-400: #7f8c95;   /* field border, muted icon: 3.45:1 on white        */
    --ds-n-500: #5f6c75;   /* text-3: hints, meta: 5.40:1 on white             */
    --ds-n-600: #4a5761;   /* text-2: labels, secondary text, icons: 7.43:1    */
    --ds-n-700: #35424b;   /* chip text, nav text: 10.3:1                      */
    --ds-n-800: #1f2a31;   /* the toast: white on it 14.7:1                    */
    --ds-n-900: #131d23;   /* ink: headings, body, values: 17.1:1              */

    --ds-surface:     var(--ds-n-0);
    --ds-canvas:      var(--ds-n-50);
    --ds-sunken:      var(--ds-n-100);
    --ds-line:        var(--ds-n-200);
    --ds-line-strong: var(--ds-n-300);
    --ds-field-line:  var(--ds-n-400);
    --ds-ink:         var(--ds-n-900);
    --ds-ink-2:       var(--ds-n-600);
    --ds-ink-3:       var(--ds-n-500);
    --ds-icon:        var(--ds-n-600);

    /* Status, muted. marker = dot, icon or 1–2 px line; text = words (≥ 4.5:1
       on white and on its own tint); bg = behind a badge's words only. */
    --ds-danger:  #c0453e; --ds-danger-text:  #a3352f; --ds-danger-bg:  #fbefee; --ds-danger-line:  #e8c5c2;
    --ds-warning: #c27f22; --ds-warning-text: #86570f; --ds-warning-bg: #fbf3e5; --ds-warning-line: #ecd5ad;
    --ds-success: #3a8a62; --ds-success-text: #276b4b; --ds-success-bg: #ecf5f0; --ds-success-line: #c2ddcf;
    --ds-info:    #4d7697; --ds-info-text:    #355d7b; --ds-info-bg:    #edf3f7; --ds-info-line:    #c7d6e2;
    /* The same four as markers on the dark toast (≥ 3:1 on --ds-n-800). */
    --ds-on-dark-success: #7cc9a1; --ds-on-dark-warning: #f0b46a; --ds-on-dark-danger: #f19a94;

    /* Diagnosis pillars. fix/look25 (25 Nov, M24-15, proposal 1 chosen): «الألوان
       تبقى بس في الاسم … باليتة … professional أكتر وبريميام أكتر». Every
       pillar card is white; its colour is in its title, in the 2 px frame round
       the card and in a very light band behind the title, nothing else. Three
       deep, muted hues — slate navy, wine, indigo — none of them a mark's red,
       green or amber or the selection teal (R-SYS-11: HSL hue 22° or more
       from each). Each title is 8:1 or more on white and 7.4:1 or more on
       its band; the three lines are 22 ΔE or more apart. The band is a
       whisper (about 5.5 ΔE off white): the title says which pillar it is.
       Ink on a band 15.7:1, ink-2 6.8:1. */
    --ds-pillar-skeletal: #1b5478;
    --ds-pillar-dental:   #574877;
    --ds-pillar-soft:     #743750;
    --ds-pillar-skeletal-tint: #eff6fe;
    --ds-pillar-dental-tint:   #f7f4fc;
    --ds-pillar-soft-tint:     #fef2f6;
    /* fix/look25: «نحاوط المربعات كلها بالـ outline السميك ده … كله متحاوط».
       The frame of a section and of every group inside it: a strong neutral
       at 3:1 on white (WCAG's line for a boundary), 2 px round a section card,
       2 px round a group too (1.5 px snaps to 1 px on a screen), 16 px between
       two groups. A pillar card's frame
       is its pillar's colour. Diagnosis and Treatment Plan. */
    --ds-frame:       #8a96a1;
    --ds-frame-card:  2px;
    --ds-frame-group: 2px;
    /* fix/look16 (R16-05): the to-do block at the top of a visit, "in red"
       («تديها له بلون أحمر»). The one status colour that fills a block: a
       wash 10 ΔE off the white card (a grey hint keeps 4.6:1 on it), and its
       answered rows' green. Only .op-todo and the Follow-up step's
       pending summary may carry them (assert-shell part look). */
    --ds-danger-wash:  #fde8e5;
    --ds-success-wash: #e0f0e6;
    /* fix/fup18 (C17-FUP-04): the visit card's still-pending group, amber
       beside the red problems and the green done (10 ΔE off the white card;
       ink-2 6.4:1 on it). Role 'alert', like the two above. */
    --ds-warning-wash: #fcedd5;
    /* fix/fup18 (C17-FUP-03/04, 17 Nov): «كله المربعات بيضة وشبه بعض … انا
       تايه». Each section of the visit form its own colour, and the visit
       card's groups the same: a marker hue (the 4 px rule and the 1 px
       outline, ≥ 4.4:1 on its own wash), a band behind the section's title
       and a wash for its body. The pillars' way (fix/look16), a new role
       'section' (assert-shell part look): a fill only inside a visit
       section or a visit card's group. Neighbouring sections' washes are
       9.6 ΔE or more apart (any two 8 or more), every band 10 or more from every other; ink is
       10.8:1 or more on a band; hints inside a section are ink-2 (5.9:1). */
    --ds-sec-plan: #187670; --ds-sec-plan-tint: #a9dfdb; --ds-sec-plan-wash: #d3f1ef;   /* What the plan says for today; the card's Payment */
    --ds-sec-comp: #7446ad; --ds-sec-comp-tint: #dcc5f6; --ds-sec-comp-wash: #eee1fb;   /* 1 · Compliance */
    --ds-sec-proc: #3b5fae; --ds-sec-proc-tint: #c0d1f8; --ds-sec-proc-wash: #dde6fc;   /* 2 · Procedures: wires, board, brackets */
    --ds-sec-mech: #7a640a; --ds-sec-mech-tint: #ecda85; --ds-sec-mech-wash: #f8efc2;   /* 3 · Mechanics */
    --ds-sec-prob: #b13a59; --ds-sec-prob-tint: #f7bfcd; --ds-sec-prob-wash: #fde0e7;   /* 4 · Problems and notes */
    --ds-sec-next: #4f7a17; --ds-sec-next-tint: #cbe6a3; --ds-sec-next-wash: #e7f4d2;   /* 5 · Next visit strategy */
    /* fix/lab18 (C17-LAB-02, 17 Nov): «احمر اصفر اخضر … لون احمر خفيف … ما
       يبقاش لون احمر فاقع». The lab orders by where they stand: light red
       not sent at all, yellow sent (in transit), green back from the lab —
       an exception, for Lab, to the calm rule that status colour stays at
       marker size (R11-SHL-01). A role of its own, 'lab' (assert-shell part
       look): a wash fills a Lab order's card and Need action's band, its line
       borders them, its tint fills the status chip; nowhere else. Ink is
       14:1 or more on all nine, ink-2 (the captions) 5.2:1 or more, the
       brand teal 4.9:1; the washes are 10–13 ΔE off the white card and 12–19
       apart, so the three read apart on a tablet. */
    --ds-lab-todo-wash: #fce5e1; --ds-lab-todo-line: #eebdb6; --ds-lab-todo-tint: #f7d0ca;
    --ds-lab-sent-wash: #fcf2d0; --ds-lab-sent-line: #e6d08a; --ds-lab-sent-tint: #f5e2a0;
    --ds-lab-back-wash: #e0f0e5; --ds-lab-back-line: #b4d6bf; --ds-lab-back-tint: #c6e3cf;

    /* Type: the fonts already loaded (Plus Jakarta Sans, IBM Plex Sans Arabic). */
    --ds-font: "Plus Jakarta Sans", "IBM Plex Sans Arabic", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --ds-fs-xs: 12px;  --ds-lh-xs: 16px;
    --ds-fs-sm: 13px;  --ds-lh-sm: 18px;
    --ds-fs-md: 14px;  --ds-lh-md: 20px;
    --ds-fs-lg: 16px;  --ds-lh-lg: 24px;
    --ds-fs-xl: 18px;  --ds-lh-xl: 26px;
    --ds-fs-2xl: 22px; --ds-lh-2xl: 30px;
    --ds-fw-regular: 400; --ds-fw-medium: 500; --ds-fw-semibold: 600;

    /* Page gutter: 24 px from 1024 up, 16 px below. */
    --ds-gutter: 24px;

    /* Space: 4 / 8. */
    --ds-sp-1: 4px; --ds-sp-2: 8px; --ds-sp-3: 12px; --ds-sp-4: 16px;
    --ds-sp-5: 24px; --ds-sp-6: 32px; --ds-sp-7: 48px; --ds-sp-8: 64px;

    /* Radius: three, plus round. */
    --ds-r-sm: 4px;    /* badges, thumbnails                          */
    --ds-r-md: 6px;    /* controls: inputs, buttons, chips, menus     */
    --ds-r-lg: 10px;   /* containers: cards, panels, modals, popovers */
    --ds-r-full: 999px;

    /* Elevation: ONE shadow, only for what floats over the page. */
    --ds-shadow: 0 8px 24px rgba(19, 29, 35, .12), 0 1px 3px rgba(19, 29, 35, .08);
    --ds-scrim:  rgba(19, 29, 35, .40);

    /* Sizes */
    --ds-h-sm: 32px; --ds-h-md: 36px;
    --ds-h-touch: 44px; --ds-h-touch-field: 48px; --ds-h-touch-primary: 52px;
    --ds-topbar-h: 52px; --ds-strip-h: 48px; --ds-index-h: 40px; --ds-bar-h: 60px;
    --ds-rail-w: 200px; --ds-lane-w: 56px;
    --ds-work-max: 1240px;   /* the step column, beside the rail */
    --ds-page-max: 1200px;   /* list pages: My cases, Money, Appointments, Clinics */
    --ds-ease: 120ms ease-out;
    /* The select's chevron: Lucide chevron-down in text-2. */
    --ds-select-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5761' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
@media (max-width: 1023px) { :root { --ds-gutter: 16px; } }

/* The brand follows a clinic's own colour from Settings. */
.op-ds {
    --ds-brand:     var(--op-primary, #136364);   /* 7.0:1 on white; white on it 7.0:1 */
    --ds-brand-700: #0e4a4b;                      /* hover, pressed, text on the tint  */
    --ds-brand-100: #d4e3e3;                      /* tint border, focus halo           */
    --ds-brand-50:  #eef4f4;                      /* "chosen / current"                */
    --ds-focus:     var(--ds-brand-700);
}
@supports (color: color-mix(in srgb, red 50%, blue)) {
    .op-ds {
        --ds-brand-700: color-mix(in srgb, var(--ds-brand) 75%, #000);
        --ds-brand-100: color-mix(in srgb, var(--ds-brand) 18%, #fff);
        --ds-brand-50:  color-mix(in srgb, var(--ds-brand) 7%, #fff);
    }
}
/* Arabic reads small at Latin sizes: the scale steps up one pixel. */
.op-ds:lang(ar), [lang="ar"] .op-ds, [dir="rtl"] .op-ds {
    --ds-fs-xs: 13px; --ds-lh-xs: 20px;  --ds-fs-sm: 14px; --ds-lh-sm: 22px;
    --ds-fs-md: 15px; --ds-lh-md: 24px;  --ds-fs-lg: 17px; --ds-lh-lg: 26px;
    --ds-fs-xl: 19px; --ds-lh-xl: 28px;  --ds-fs-2xl: 23px; --ds-lh-2xl: 32px;
}

/* ---- 0b. The legacy tokens, re-pointed (spec 3.2) ---------------------------
   Every var(--op-*) in public.css and the modules takes the calm values. */
.op-ds {
    --op-bg: var(--ds-canvas);        --op-bg-alt: var(--ds-sunken);     --op-surface: var(--ds-surface);
    --op-border: var(--ds-line);      --op-border-strong: var(--ds-line-strong);
    --op-line: var(--ds-line);        --op-line-strong: var(--ds-line-strong);
    --op-text: var(--ds-ink);         --op-text-muted: var(--ds-ink-2);  --op-text-soft: var(--ds-ink-3);
    --op-primary-dark: var(--ds-brand-700); --op-primary-hover: var(--ds-brand-700);
    --op-primary-light: var(--ds-brand-50);
    /* Gold leaves the UI. Every hover and "current" that used it is neutral. */
    --op-accent: var(--ds-line-strong); --op-accent-dark: var(--ds-ink-2);
    --op-accent-light: var(--ds-n-50);  --op-accent-text: var(--ds-ink);
    --op-success: var(--ds-success); --op-success-bg: var(--ds-success-bg); --op-success-text: var(--ds-success-text);
    --op-warning: var(--ds-warning); --op-warning-bg: var(--ds-warning-bg); --op-warning-text: var(--ds-warning-text);
    --op-danger:  var(--ds-danger);  --op-danger-bg:  var(--ds-danger-bg);  --op-danger-text:  var(--ds-danger-text);
    --op-info:    var(--ds-info);    --op-info-bg:    var(--ds-info-bg);    --op-info-text:    var(--ds-info-text);
    --op-late: var(--ds-danger); --op-late-bg: var(--ds-danger-bg); --op-late-text: var(--ds-danger-text);
    --op-pillar-skeletal: var(--ds-pillar-skeletal); --op-pillar-skeletal-bg: transparent;
    --op-pillar-dental:   var(--ds-pillar-dental);   --op-pillar-dental-bg:   transparent;
    --op-pillar-soft:     var(--ds-pillar-soft);     --op-pillar-soft-bg:     transparent;
    --op-radius-sm: var(--ds-r-md); --op-radius: var(--ds-r-md);
    --op-radius-md: var(--ds-r-lg); --op-radius-lg: var(--ds-r-lg);
    --op-shadow-sm: none; --op-shadow: none; --op-shadow-md: none; --op-shadow-lg: var(--ds-shadow);
    --op-topbar-height: var(--ds-topbar-h);
    --op-wizard-h: var(--ds-bar-h);
    --op-sidebar-width: 220px;
    --op-lane-w: var(--ds-lane-w);
    --op-font-mono: var(--ds-font);   /* no monospace: case codes, order numbers, dates, phones */
    font-family: var(--ds-font);
    font-size: var(--ds-fs-md); line-height: var(--ds-lh-md); color: var(--ds-ink);
    font-variant-numeric: tabular-nums;
}
.op-ds .op-mono { font-family: inherit; font-size: inherit; letter-spacing: 0; }

/* ---- 0c. Clinical colours stay inside the charts (spec 3.3) ----------------
   The tooth charts, the board and the static figures keep the registry's
   hues: the four status tokens point back at the registry marks there. */
.op-ds :is(.op-toothchart, .op-mech, .op-tc-states, .tchart) {
    --op-success: var(--op-mark-bonded);
    --op-danger:  var(--op-mark-extract);
    --op-warning: var(--op-mark-flip);
    --op-info:    var(--op-mark-cross);
}
/* One softening: a bonded crown is a tint with the bonded colour as its
   outline, not a solid green tooth — Clinical Steps stops being a wall of
   green. Extraction stays solid red: it is the alarm. */
.op-ds .op-tc-tooth.is-base:not(.is-on) .op-tc-crown,
.op-ds .op-tc-tooth.op-tc-tone-success.is-on .op-tc-crown {
    fill: #b7e2d3;
    fill: color-mix(in srgb, var(--op-mark-bonded) 30%, #fff);
    stroke: var(--op-mark-bonded); stroke-width: 1.5;
}

/* ---- 1. Base and focus (spec 7.1) ------------------------------------------- */
.op-ds { background: var(--ds-canvas); }
.op-ds :is(a, button, summary, [tabindex], .op-chip, .op-tab-link):focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.op-ds :is(input, select, textarea):focus-visible { outline: none; }
.op-ds a { color: var(--ds-brand); }
.op-ds a:hover { color: var(--ds-brand-700); }
.op-ds :is(h1, h2, h3, h4) { letter-spacing: normal; color: var(--ds-ink); }
/* No weight above 600 (spec 5): the browser's own bold on strong, b, th and
   headings is 700. Any class rule still decides its own weight. */
.op-ds :is(strong, b, h1, h2, h3, h4, h5, h6, th) { font-weight: 600; }

/* ---- 2. The app frame (inside our full-screen template) -----------------------
   The topbar and the case strip run edge to edge on every page, so the logo
   sits at the gutter everywhere and keeping the dock open moves nothing in
   them (the 3.0 bar narrowed by the dock's width). */
@media (min-width: 1280px) {
    body.orthoplan-fullscreen .op-frontend.op-ds.op-app {
        max-width: none; padding-inline-start: var(--ds-gutter);
        --ds-pad-end: var(--ds-gutter);
    }
    body.orthoplan-fullscreen .op-frontend.op-ds.op-app:not(.op-has-dock):not(.op-dock-pinned) { padding-inline-end: var(--ds-gutter); }
    body.orthoplan-fullscreen .op-frontend.op-ds.op-app.op-has-dock { --ds-pad-end: calc(var(--op-lane-w, 56px) + 28px); }
    body.orthoplan-fullscreen .op-frontend.op-ds.op-app.op-dock-pinned { --ds-pad-end: calc(var(--op-dock-w, 400px) + 16px); }
    body.orthoplan-fullscreen .op-frontend.op-ds.op-app .op-topbar {
        margin-inline: calc(-1 * var(--ds-gutter)) calc(-1 * var(--ds-pad-end)); padding-inline: var(--ds-gutter);
    }
}
/* Below 1280 the frame's side padding is the gutter too (the template's 14 px
   at ≤ 700 left the edge-to-edge strip, cards and bar 2 px past a 360 screen). */
@media (max-width: 1279px) {
    body.orthoplan-fullscreen .op-frontend.op-ds.op-app:not(.op-shell) { padding-inline: var(--ds-gutter); }
    body.orthoplan-fullscreen .op-frontend.op-ds.op-app:not(.op-shell) .op-topbar { margin-inline: calc(-1 * var(--ds-gutter)); padding-inline: var(--ds-gutter); }
}
/* The strip sits right under the bar: no sliver of canvas between them. */
body.orthoplan-fullscreen .op-frontend.op-ds .op-topbar { margin-block: 0; }
body.orthoplan-fullscreen .op-frontend.op-ds:not(.op-shell):not(.op-auth):not(.op-app):not(.op-case-detail) {
    --ds-page-pad: max(var(--ds-gutter), calc((100vw - var(--ds-page-max)) / 2));
    max-width: none; padding-inline: var(--ds-page-pad);
}
body.orthoplan-fullscreen .op-frontend.op-ds:not(.op-shell):not(.op-auth):not(.op-app):not(.op-case-detail) > .op-topbar {
    margin-inline: calc(-1 * var(--ds-page-pad)); padding-inline: var(--ds-gutter);
}
.op-ds .op-topbar {
    min-height: var(--ds-topbar-h); padding-block: 8px; box-sizing: border-box; margin-bottom: 0;
    background: var(--ds-surface); border-bottom: 1px solid var(--ds-line); box-shadow: none;
}
/* The topbar (spec 8.2): the logo plate with a gap before the name, then
   ghost buttons and 36 px icon buttons, one avatar disc. */
.op-ds .op-topbar-brand { display: inline-flex; align-items: center; gap: 10px; }
.op-ds .op-topbar-brand .op-logo-plate { height: 32px; padding: 6px 10px; border-radius: var(--ds-r-md); box-sizing: border-box; display: inline-flex; align-items: center; }
.op-ds .op-topbar-brand .op-logo-plate img, .op-ds .op-topbar-brand > .op-topbar-logo-img { max-height: 20px; width: auto; }
.op-ds .op-brand-name { font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-topbar-actions { display: flex; align-items: center; gap: 4px; }
.op-ds .op-clinic-chip {
    display: inline-flex; align-items: center; gap: 8px; height: var(--ds-h-md); padding: 0 10px; max-width: 26ch;
    border: 0; border-radius: var(--ds-r-md); background: none; box-shadow: none;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); cursor: pointer;
}
.op-ds .op-clinic-chip:hover { background: var(--ds-sunken); }
.op-ds .op-clinic-chip-name { max-width: 18ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-ds .op-clinic-chip .op-ic { color: var(--ds-icon); }
.op-ds .op-bell-btn {
    width: var(--ds-h-md); height: var(--ds-h-md); display: inline-flex; align-items: center; justify-content: center; position: relative;
    border-radius: var(--ds-r-md); color: var(--ds-icon) !important; font-size: 0;
}
.op-ds .op-bell-btn:hover { background: var(--ds-sunken) !important; }
.op-ds .op-bell-btn .op-ic { width: 18px; height: 18px; }
.op-ds .op-bell-count { position: absolute; top: 2px; inset-inline-end: 0; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; font: 600 11px/16px var(--ds-font); }
.op-ds .op-topbar-user { align-items: center; gap: 8px; font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-topbar-avatar {
    width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ds-brand-50); color: var(--ds-brand-700); font: 600 var(--ds-fs-sm)/1 var(--ds-font); border: 0;
}
.op-ds .op-topbar-signout .op-ic, .op-ds .op-topbar-consult .op-ic { color: var(--ds-icon); }
@media (max-width: 900px) {
    .op-ds .op-topbar-username, .op-ds .op-topbar-consult .op-btn-text { display: none; }
}
@media (max-width: 640px) {
    .op-ds .op-brand-name { display: none; }
    .op-ds .op-clinic-chip-name { max-width: 12ch; }
}
/* The step column stops at 1240: a 1,500 px form line is harder to read. */
@media (min-width: 1280px) {
    .op-ds.op-app .op-workarea { max-width: var(--ds-work-max); }
}

/* ---- 3. The case strip: sticky, one line, the name never cut (spec 8.3) ---- */
.op-ds .op-casebar {
    flex-direction: row; justify-content: flex-start;
    position: sticky; top: var(--op-stick-top, var(--op-topbar-height, 52px)); z-index: 41;
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
    margin: 0 calc(-1 * var(--ds-gutter)) var(--ds-sp-4); padding: 6px var(--ds-gutter);
    min-height: var(--ds-strip-h); box-sizing: border-box;
    background: var(--ds-surface); border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0; box-shadow: none;
}
@media (min-width: 1280px) {
    /* Edge to edge over the filmstrip's lane or the kept-open dock as well. */
    .op-ds.op-app .op-casebar { margin-inline-end: calc(-1 * var(--ds-pad-end, var(--ds-gutter))); padding-inline-end: var(--ds-gutter); }
}
.op-ds .op-casebar > .op-casebar-id {
    display: flex; flex-wrap: nowrap; align-items: center; gap: 2px 14px;
    flex: 1 1 0; min-width: min-content;
}
.op-ds .op-casebar .op-back-link {
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2) !important; text-decoration: none !important;
}
.op-ds .op-casebar .op-back-link:hover { color: var(--ds-ink) !important; }
/* The legacy 8 px under the back link made the strip 53 px, not 48. */
.op-ds .op-casebar .op-back-link { margin-block: 0; }
.op-ds .op-casebar h1 {
    display: flex; align-items: baseline; gap: 10px;
    margin: 0; font: 600 var(--ds-fs-xl)/var(--ds-lh-xl) var(--ds-font); color: var(--ds-ink);
    white-space: nowrap; flex: none; unicode-bidi: plaintext;
}
.op-ds .op-casebar-code { font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-casebar-dash { display: none; }
.op-ds .op-casebar-name { font: inherit; color: inherit; unicode-bidi: isolate; }
.op-ds .op-casebar .op-case-subline {
    /* width 0: it gives up all its room before the name gives up any. */
    flex: 1 1 0; width: 0; min-width: 0; margin: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2);
}
.op-ds .op-casebar .op-case-head-actions {
    display: flex; align-items: center; gap: 12px; margin-inline-start: auto; flex-wrap: wrap;
}
@media (max-width: 1100px) {
    .op-ds .op-casebar .op-case-subline { display: none; }
}
@media (max-width: 767px) {
    .op-ds .op-casebar { gap: 2px 10px; padding-block: 6px; }
    .op-ds .op-casebar > .op-casebar-id { flex-basis: 100%; flex-wrap: wrap; min-width: 0; gap: 2px 10px; }
    .op-ds .op-casebar h1 { white-space: normal; flex: 1 1 auto; flex-wrap: wrap; row-gap: 0; font-size: var(--ds-fs-lg); line-height: var(--ds-lh-lg); }
    .op-ds .op-casebar .op-case-head-actions { margin-inline-start: 0; }
    /* Export lives on Summary & Export too; on a phone the strip keeps the status. */
    .op-ds .op-casebar .op-case-head-actions > .op-btn { display: none; }
}
@media (max-width: 640px) {
    /* Line 1: back, the name and the code. Line 2: the status. The title
       block keeps the whole width (assert-mobile: nothing sits beside it). */
    .op-ds .op-casebar > .op-casebar-id { flex-wrap: nowrap; align-items: center; }
    .op-ds .op-casebar .op-back-label { display: none; }
    .op-ds .op-casebar .op-back-link { min-width: 32px; min-height: 32px; justify-content: center; margin-inline-start: -8px; }
    .op-ds .op-casebar h1 { flex-wrap: wrap; align-items: baseline; gap: 0 8px; }
    .op-ds .op-casebar-name { order: -1; }
    .op-ds .op-casebar-code { font-size: var(--ds-fs-xs); line-height: var(--ds-lh-xs); }
}

/* ---- 4. The step bar (< 1280): grouped by phase, wraps, no container ---------- */
.op-ds .op-sequence > .op-tabs-nav,
[dir="rtl"] .op-ds .op-sequence > .op-tabs-nav {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
    overflow: visible; padding: 0; margin-bottom: var(--ds-sp-4);
    background: none; border: 0; border-radius: 0; box-shadow: none;
    -webkit-mask-image: none; mask-image: none;
}
.op-ds .op-step-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.op-ds .op-step-phase {
    display: inline-flex; align-items: center; padding-inline: 2px 6px;
    font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); text-transform: none; letter-spacing: normal;
    color: var(--ds-ink-3); white-space: nowrap;
}
.op-ds .op-sequence .op-tab-link {
    display: inline-flex; align-items: center; gap: 8px; min-height: var(--ds-h-md); padding: 6px 10px;
    border: 0 !important; border-radius: var(--ds-r-md); box-shadow: none !important;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font) !important;
    color: var(--ds-n-700) !important; background: none !important; text-decoration: none !important;
}
.op-ds .op-sequence .op-tab-link:hover { background: var(--ds-sunken) !important; color: var(--ds-ink) !important; }
.op-ds .op-sequence .op-tab-link.active {
    background: var(--ds-brand-50) !important; color: var(--ds-brand-700) !important;
    font-weight: 600 !important; border-color: transparent !important;
}
.op-ds .op-sequence .op-tab-num {
    display: inline-flex; align-items: center; justify-content: center; flex: none;
    width: 20px; height: 20px; border-radius: 50%; border: 0;
    background: var(--ds-sunken); color: var(--ds-ink-2); font: 600 var(--ds-fs-xs)/20px var(--ds-font);
}
.op-ds .op-sequence .op-tab-link.active .op-tab-num { background: var(--ds-brand); color: var(--ds-n-0); }
.op-ds .op-sequence .op-tab-icon { display: none; }
.op-ds .op-tab-lock { display: inline-flex; color: var(--ds-ink-3); font-size: var(--ds-fs-xs); }
@media (max-width: 640px) {
    /* One flowing row of numbered discs; only the open step keeps its name. */
    .op-ds .op-step-group { display: contents; }
    .op-ds .op-step-phase { display: none; }
    .op-ds .op-sequence > .op-tabs-nav { gap: 4px; }
}

/* ---- 5. The step rail: ≥ 1280, in the app (spec 8.6) -------------------------
   Every step on screen at every height down to 1280 × 720 (R-SYS-20). No card:
   the rail is a column of links on the canvas. */
@media (min-width: 1280px) {
    .op-ds.op-app .op-tabs-wrapper.op-sequence {
        display: grid; grid-template-columns: var(--ds-rail-w) minmax(0, 1fr);
        column-gap: var(--ds-sp-5); align-items: start; margin-top: 4px;
    }
    .op-ds.op-app .op-sequence > .op-tabs-nav,
    [dir="rtl"] .op-ds.op-app .op-sequence > .op-tabs-nav {
        position: sticky; top: var(--op-chrome-top, 140px); z-index: 20;
        flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 0;
        max-height: calc(100vh - var(--op-chrome-top, 140px) - var(--op-wizard-h, 60px) - 16px);
        overflow-y: auto; overflow-x: hidden; margin: 0; padding: 0;
        background: none; border: 0; border-radius: 0; box-shadow: none; scrollbar-width: thin;
    }
    .op-ds.op-app .op-step-group { flex-direction: column; align-items: stretch; flex-wrap: nowrap; gap: 1px; }
    .op-ds.op-app .op-step-group + .op-step-group { padding: 0; border: 0; margin-top: var(--ds-sp-4); }
    .op-ds.op-app .op-step-phase { padding: 8px 10px 4px; font-size: var(--ds-fs-xs); line-height: var(--ds-lh-xs); font-weight: 500; }
    .op-ds.op-app .op-sequence .op-tab-link {
        justify-content: flex-start; width: 100%; box-sizing: border-box;
        min-height: var(--ds-h-md); padding: 6px 10px; border-radius: var(--ds-r-md);
        white-space: normal; text-align: start;
    }
    .op-ds.op-app .op-workarea { min-width: 0; }
}
@media (min-width: 1280px) and (max-height: 820px) {
    /* A 1280 × 720 laptop: eleven steps and four phases in 450 px. */
    .op-ds.op-app .op-sequence .op-tab-link { min-height: 32px; padding-block: 3px; }
    .op-ds.op-app .op-step-phase { padding-block: 2px 0; }
    .op-ds.op-app .op-step-group + .op-step-group { margin-top: 4px; }
}

/* ---- 6. "On this step": a line under the strip (spec 8.5) ------------------- */
.op-ds .op-step-index {
    position: sticky; top: calc(var(--op-chrome-top, 140px) - 8px); z-index: 19;
    display: flex; align-items: center; gap: 8px 16px;
    margin: 0 0 var(--ds-sp-4); padding: 0; min-height: var(--ds-index-h);
    background: var(--ds-canvas); border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0; box-shadow: none;
}
.op-ds .op-step-index[hidden] { display: none; }
.op-ds .op-step-index-label {
    font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); text-transform: none; letter-spacing: normal;
    color: var(--ds-ink-3); white-space: nowrap;
}
.op-ds .op-step-index-list {
    --end: right;
    display: flex; gap: 0; overflow-x: auto; min-width: 0; flex: 1; scrollbar-width: thin;
    /* A mask, not a colour: opaque, then fading out over the last 24 px. */
    -webkit-mask-image: linear-gradient(to var(--end), black calc(100% - 24px), transparent);
    mask-image: linear-gradient(to var(--end), black calc(100% - 24px), transparent);
}
[dir="rtl"] .op-ds .op-step-index-list { --end: left; }
.op-ds .op-step-index { box-sizing: border-box; }
.op-ds .op-step-index-link {
    display: inline-flex; align-items: center; gap: 8px; flex: none;
    min-height: 39px; padding: 0 2px; margin-inline-end: 16px; box-sizing: border-box;
    border-radius: 0; background: none !important; border-bottom: 2px solid transparent; box-shadow: none !important;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); white-space: nowrap;
    color: var(--ds-ink-2) !important; text-decoration: none !important;
}
.op-ds .op-step-index-link:hover { color: var(--ds-ink) !important; }
.op-ds .op-step-index-link.is-current { color: var(--ds-brand-700) !important; border-bottom-color: var(--ds-brand); }
/* Pillar sections keep their 8 px dot here too (op-shell.js copies data-pillar). */
.op-ds .op-step-index-link[data-pillar]::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--ds-pillar-skeletal);
}
.op-ds .op-step-index-link[data-pillar="dental"]::before { background: var(--ds-pillar-dental); }
.op-ds .op-step-index-link:is([data-pillar="soft"], [data-pillar="extra"])::before { background: var(--ds-pillar-soft); }
.op-ds .op-step-index-fold {
    flex: none; min-height: var(--ds-h-sm); padding: 0 8px; cursor: pointer;
    border: 0; border-radius: var(--ds-r-md); background: none;
    color: var(--ds-ink-2); font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font);
}
.op-ds .op-step-index-fold:hover { background: var(--ds-sunken); color: var(--ds-ink); }
@media (max-width: 640px) {
    .op-ds .op-step-index { position: static; }
    .op-ds .op-step-index-label { display: none; }
}
/* A jump lands below the sticky chrome and the index. */
.op-ds .op-tab-panel .op-card, .op-ds [data-op-anchor] {
    scroll-margin-top: calc(var(--op-chrome-top, 140px) + var(--op-index-h, 0px) + 12px);
}

/* ---- 7. Section cards and heads (spec 7.2) ---------------------------------
   The section card is the only container. No bands, no tinted borders, no
   shadow; a pillar keeps an 8 px dot before its title (client question 16). */
.op-ds .op-card {
    background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg);
    box-shadow: none; padding: var(--ds-sp-5); margin-bottom: var(--ds-sp-4);
}
.op-ds .op-card > :last-child { margin-bottom: 0; }
.op-ds .op-card.op-pillar-card { border: 1px solid var(--ds-line); }
.op-ds .op-card > .op-fsec-head:first-child:not(summary) {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
    margin: 0 0 var(--ds-sp-4); padding: 0; min-height: 32px; box-sizing: border-box;
    background: none; border: 0; border-radius: 0;
}
.op-ds .op-fsec-head { border-inline-start: 0; padding-inline-start: 0; background: none; }
.op-ds .op-fsec-head.op-pillar-head { background: none; }
.op-ds .op-fsec-title {
    flex: 1 1 auto; min-width: 0; margin: 0;
    font: 600 var(--ds-fs-lg)/var(--ds-lh-lg) var(--ds-font); color: var(--ds-ink); letter-spacing: normal;
}
.op-ds .op-card .op-fsec-head .op-fsec-title { color: var(--ds-ink); }
.op-ds .op-fsec-sub {
    flex-basis: 100%; order: 5; margin: 0;
    font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2);
}
.op-ds .op-fsec-head > .op-modify { order: 2; margin-inline-start: auto; }
.op-ds .op-card:is(.op-fsec-skeletal, .op-fsec-dental, .op-fsec-soft, .op-fsec-extra) > .op-fsec-head:first-child .op-fsec-title::before {
    content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
    margin-inline-end: 10px; vertical-align: 2px; background: var(--ds-pillar, var(--ds-pillar-skeletal));
}
.op-ds .op-card.op-fsec-skeletal { --ds-pillar: var(--ds-pillar-skeletal); }
.op-ds .op-card.op-fsec-dental { --ds-pillar: var(--ds-pillar-dental); }
.op-ds .op-card:is(.op-fsec-soft, .op-fsec-extra) { --ds-pillar: var(--ds-pillar-soft); }
/* A second head inside the same card is a sub-section: a hairline, no band. */
.op-ds .op-card > .op-fsec-head:not(:first-child) {
    margin: var(--ds-sp-6) 0 var(--ds-sp-3); padding-top: var(--ds-sp-5); border-top: 1px solid var(--ds-line);
}
.op-ds .op-card > .op-fsec-head:not(:first-child) .op-fsec-title { font-size: var(--ds-fs-md); line-height: var(--ds-lh-md); }
/* A field group: a 14 px heading, no rule line, no start bar. The divider is
   the one its wrapper (.op-fsub-block) already draws; only one hairline. */
.op-ds .op-fsub {
    display: block; margin: 0 0 var(--ds-sp-3); padding: 0; border: 0;
    font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink);
    text-transform: none; letter-spacing: normal;
}
.op-ds .op-fsub::after { content: none; }
.op-ds .op-dx-block > .op-fsub { border: 0; padding-inline-start: 0; }
.op-ds .op-fsub-block { margin-top: var(--ds-sp-5); padding-top: var(--ds-sp-5); border-top: 1px solid var(--ds-line); }
.op-ds .op-fsec-head + .op-fsub-block, .op-ds .op-fsub-block:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
/* The read-only card of a locked step: a normal card, a small lock. */
.op-ds .op-locked-step { text-align: center; }
.op-ds .op-locked-icon { font-size: var(--ds-fs-lg); color: var(--ds-icon); margin-bottom: var(--ds-sp-2); }
/* Unbox the secondary cards: one box level (spec 9.3). */
.op-ds :is(.op-subcard, .op-measure-card, .op-problem-card, .op-retention-card, .op-history-card) {
    border: 0; background: none; padding: 0; box-shadow: none; border-radius: 0;
}
.op-ds :is(.op-subcard, .op-measure-card) { margin: 0; }
/* Clinical background: a 2-column list, label … [No][Yes], a hairline per row. */
.op-ds .op-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 48px; row-gap: 0; }
.op-ds .op-history-grid > .op-history-card { border-bottom: 1px solid var(--ds-line); padding: 4px 0; }
.op-ds .op-history-head { min-height: 44px; justify-content: space-between; align-items: center; }
.op-ds .op-history-head > * { margin-block: 0; }
@media (max-width: 640px) { .op-ds .op-history-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- 8. Folding (spec 7.3) ---------------------------------------------------- */
.op-ds .op-fold-btn {
    order: 3; flex: none; width: 32px; height: 32px; margin-inline-start: 4px; padding: 0;
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    border: 0; border-radius: var(--ds-r-md); background: none; color: var(--ds-icon);
    font: inherit; font-size: 0; line-height: 1;
}
.op-ds .op-fold-btn:hover { background: var(--ds-sunken); color: var(--ds-ink); }
.op-ds .op-fold-btn > span { display: inline-block; transition: transform var(--ds-ease); }
.op-ds .op-fold-btn > span:not(.op-ic) {
    width: 16px; height: 16px; background: currentColor;
    -webkit-mask: var(--op-ic-chev-down) center / contain no-repeat; mask: var(--op-ic-chev-down) center / contain no-repeat;
}
.op-ds .op-card.is-folded .op-fold-btn > span { transform: rotate(-90deg); }
[dir="rtl"] .op-ds .op-card.is-folded .op-fold-btn > span { transform: rotate(90deg); }
.op-ds .op-fold-sum { display: none; }
.op-ds .op-card.is-folded .op-fold-sum {
    display: block; order: 6; flex-basis: 100%; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2);
    unicode-bidi: plaintext; text-align: start;
}
.op-ds .op-card.is-folded > .op-fsec-head ~ .op-fsec-sub { display: none; }
.op-ds .op-card.op-foldable.is-folded > :not(.op-fsec-head:first-child) { display: none; }
.op-ds .op-card.op-foldable.is-folded { padding-block: var(--ds-sp-4); }
.op-ds .op-card.op-foldable.is-folded > .op-fsec-head:first-child { margin-bottom: 0; }
.op-ds .op-card.op-foldable.is-folded > .op-fsec-head:first-child .op-fsec-sub { display: none; }
/* Every other fold: the same chevron at the inline end of its row. */
.op-ds :is(.op-visit-fold, .op-visit-sec, .op-visit-subsec, .op-lab-book, .op-lab-ship-fold, .op-gallery-compare, .op-note-fold, .op-hours-card, .op-consent-rules-card, .op-mysig, .op-desk-card) > summary {
    display: flex; align-items: center; gap: 8px; min-height: 40px; cursor: pointer; list-style: none;
    font: 500 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink);
}
.op-ds :is(.op-visit-fold, .op-visit-sec, .op-visit-subsec, .op-lab-book, .op-lab-ship-fold, .op-gallery-compare, .op-note-fold, .op-hours-card, .op-consent-rules-card, .op-mysig, .op-desk-card) > summary::-webkit-details-marker { display: none; }
.op-ds :is(.op-visit-fold, .op-visit-sec, .op-visit-subsec, .op-lab-book, .op-lab-ship-fold, .op-gallery-compare, .op-note-fold, .op-hours-card, .op-consent-rules-card, .op-mysig, .op-desk-card) > summary::after {
    content: ''; flex: none; width: 16px; height: 16px; margin-inline-start: auto; background: var(--ds-icon);
    -webkit-mask: var(--op-ic-chev-down) center / contain no-repeat; mask: var(--op-ic-chev-down) center / contain no-repeat;
    transition: transform var(--ds-ease); transform: rotate(-90deg); border: 0;
}
[dir="rtl"] .op-ds :is(.op-visit-fold, .op-visit-sec, .op-visit-subsec, .op-lab-book, .op-lab-ship-fold, .op-gallery-compare, .op-note-fold, .op-hours-card, .op-consent-rules-card, .op-mysig, .op-desk-card) > summary::after { transform: rotate(90deg); }
/* The 3.0 glyphs (▾ ▴ ▸ ◂) are set on the open and shut states at a higher
   specificity; the same selectors here keep the line chevron in both. */
.op-ds :is(.op-visit-fold, .op-visit-sec, .op-visit-subsec, .op-lab-book, .op-lab-ship-fold, .op-gallery-compare, .op-note-fold, .op-hours-card, .op-consent-rules-card, .op-mysig, .op-desk-card)[open] > summary::after,
.op-ds :is(.op-visit-fold, .op-visit-sec, .op-visit-subsec, .op-lab-book, .op-lab-ship-fold, .op-gallery-compare, .op-note-fold, .op-hours-card, .op-consent-rules-card, .op-mysig, .op-desk-card):not([open]) > summary::after,
[dir="rtl"] .op-ds :is(.op-visit-fold, .op-visit-sec, .op-visit-subsec, .op-lab-book, .op-lab-ship-fold, .op-gallery-compare, .op-note-fold, .op-hours-card, .op-consent-rules-card, .op-mysig, .op-desk-card):not([open]) > summary::after { content: ''; }
.op-ds :is(.op-visit-fold, .op-visit-sec, .op-visit-subsec, .op-lab-book, .op-lab-ship-fold, .op-gallery-compare, .op-note-fold, .op-hours-card, .op-consent-rules-card, .op-mysig, .op-desk-card)[open] > summary::after { transform: none; }
.op-ds details.op-visit-sec > summary { font-weight: 600; color: var(--ds-ink); }
/* ONE fold affordance: the 3.0 CSS caret at the start of each visit-form
   section goes (in Arabic it pointed the wrong way); the sub-sections lose the
   browser's own triangle and take the same chevron at the end. */
.op-ds details.op-visit-sec > summary.op-visit-sec-title::before { content: none; display: none; }
.op-ds details.op-visit-subsec > summary.op-visit-sec-sub {
    display: flex; list-style: none; margin: var(--ds-sp-3) 0 var(--ds-sp-2);
    font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); text-transform: none; letter-spacing: normal;
}
/* "Last time you wrote": a quiet quote, no teal bar or tint. */
.op-ds .op-plan-strategy {
    border: 0; border-radius: var(--ds-r-md); background: var(--ds-n-50); padding: 12px; margin: 0 0 var(--ds-sp-3);
    font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink);
}
.op-ds .op-plan-strategy b { display: block; margin-bottom: 2px; font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); text-transform: none; letter-spacing: normal; }
.op-ds h6.op-visit-sec-sub { font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); text-transform: none; letter-spacing: normal; }
/* "+ Crossbite notes": a link aligned with the labels. */
.op-ds .op-note-fold-toggle {
    display: inline-flex; align-items: center; margin-inline-start: 0; padding: 6px 0; min-height: 0;
    border: 0 !important; background: none !important; box-shadow: none;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-brand) !important; cursor: pointer;
}
.op-ds .op-note-fold-toggle:hover { text-decoration: underline; }

/* ---- 9. Choice chips (spec 7.4): one chip for every choice -------------------- */
.op-ds .op-chips { display: flex; flex-wrap: wrap; gap: 6px; background: none; padding: 0; border-radius: 0; }
.op-ds :is(.op-chip, .op-toggle-btn) {
    min-height: var(--ds-h-sm); padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); letter-spacing: normal; text-transform: none;
    color: var(--ds-n-700) !important; background: var(--ds-surface) !important;
    border: 1px solid var(--ds-line-strong) !important; border-radius: var(--ds-r-md) !important;
    box-shadow: none; transform: none;
}
@media (hover: hover) {
    .op-ds :is(.op-chip, .op-toggle-btn):not(.is-active):not([aria-pressed="true"]):not([aria-checked="true"]):hover:not(:disabled) {
        background: var(--ds-n-50) !important; border-color: var(--ds-field-line) !important; color: var(--ds-ink) !important;
    }
}
.op-ds :is(.op-chip, .op-toggle-btn):is(.is-active, [aria-pressed="true"], [aria-checked="true"]) {
    background: var(--ds-brand-50) !important; color: var(--ds-brand-700) !important;
    border-color: var(--ds-brand) !important; box-shadow: inset 0 0 0 1px var(--ds-brand); font-weight: 600;
}
.op-ds :is(.op-chip, .op-toggle-btn).is-active:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ds-brand); }
.op-ds .op-chip.is-oneoff { border-style: dashed !important; }
.op-ds :is(.op-chip, .op-toggle-btn):disabled { opacity: .5; }
.op-ds .op-chip:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
/* Pick many: the chosen chip shows a check. */
.op-ds .op-chips[role="group"] .op-chip:is(.is-active, [aria-pressed="true"])::before {
    content: ''; width: 14px; height: 14px; flex: none; background: currentColor;
    -webkit-mask: var(--op-ic-check) center / contain no-repeat; mask: var(--op-ic-check) center / contain no-repeat;
}
/* Tone chips (Class I/II/III, MIN/MOD/MAX, Yes/Not yet): neutral, with a dot. */
.op-ds .op-chip:is(.op-chip-success, .op-chip-warn, .op-chip-danger, .op-chip-info) { color: var(--ds-n-700) !important; border-color: var(--ds-line-strong) !important; background: var(--ds-surface) !important; }
.op-ds .op-chip:is(.op-chip-success, .op-chip-warn, .op-chip-danger, .op-chip-info)::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--tone);
}
.op-ds .op-chip-success { --tone: var(--ds-success); }
.op-ds .op-chip-warn { --tone: var(--ds-warning); }
.op-ds .op-chip-danger { --tone: var(--ds-danger); }
.op-ds .op-chip-info { --tone: var(--ds-info); }
.op-ds .op-chip:is(.op-chip-success, .op-chip-warn, .op-chip-danger, .op-chip-info):is(.is-active, [aria-checked="true"], [aria-pressed="true"]) {
    background: var(--ds-brand-50) !important; color: var(--ds-brand-700) !important; border-color: var(--ds-brand) !important;
}
/* Tone groups (Buccal): no boxes; the caption carries the dot. */
.op-ds .op-chips-grouped { gap: var(--ds-sp-4) var(--ds-sp-5); }
.op-ds .op-chip-group { border: 0; background: none; padding: 0; gap: 6px; }
.op-ds .op-chip-group-cap {
    display: flex; align-items: center; gap: 6px;
    font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2) !important;
    text-transform: none; letter-spacing: normal;
}
.op-ds .op-chip-group-cap::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--tone, var(--ds-n-400)); }
.op-ds .op-chip-group-success { --tone: var(--ds-success); }
.op-ds .op-chip-group-warn { --tone: var(--ds-warning); }
.op-ds .op-chip-group-danger { --tone: var(--ds-danger); }
.op-ds .op-chip-group .op-chip::before { content: none; }
.op-ds .op-chip-rule { background: var(--ds-line); }
/* Yes / No: two chips; the label sits above like every other field. */
.op-ds .op-toggle { display: inline-flex; gap: 6px; background: none; padding: 0; border: 0; border-radius: 0; }
.op-ds .op-dx-yesno { display: block; }
.op-ds .op-dx-yesno > .op-fsub {
    margin: 0 0 6px; font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2);
}
/* The tooth picker: quadrants laid out like a dental chart.
   fix/teeth18 (C17-DIA-02): one row of eight a quadrant from the midline,
   the layout in op-components.css; here only the calm look of a tooth's box
   (a chip's colours: neutral, the brand tint when chosen) and its dashes. */
.op-ds .op-tpick-quad { border-radius: 0; padding: 0; box-shadow: none; }
.op-ds .op-tpick-quad:is([data-quad="ur"], [data-quad="lr"]) > .op-tpick-pos,
.op-ds .op-tpick-quad:is([data-quad="ul"], [data-quad="ll"]) > .op-tpick-pos { border-color: var(--ds-line-strong); }
.op-ds .op-tpick-quad:is([data-quad="ur"], [data-quad="ul"]) { border-bottom-color: var(--ds-line-strong); }
.op-ds .op-tpick .op-quadrant-label { font: 600 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-tpick-whole-words { color: var(--ds-ink-2); }
.op-ds .op-tpick-n {
    font: 500 var(--ds-fs-xs)/1 var(--ds-font); color: var(--ds-n-700);
    background: var(--ds-surface); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-md);
}
@media (hover: hover) {
    .op-ds .op-tpick-chip:not(:disabled):not(.is-active):hover .op-tpick-n { background: var(--ds-n-50); border-color: var(--ds-field-line); color: var(--ds-ink); }
}
.op-ds .op-tpick-chip.is-active .op-tpick-n {
    background: var(--ds-brand-50); color: var(--ds-brand-700); border-color: var(--ds-brand);
    box-shadow: inset 0 0 0 1px var(--ds-brand); font-weight: 600;
}
.op-ds .op-tpick-chip:focus-visible { outline: none; }
.op-ds .op-tpick-chip:focus-visible .op-tpick-n { outline: 2px solid var(--ds-focus); outline-offset: 1px; }
.op-ds .op-crossbite-quad { border: 0; background: none; border-radius: 0; box-shadow: none; }
/* Chart state chips (Bypass / Extra-bond, the pens): chips with a 10 px swatch. */
.op-ds .op-tc-state { border-radius: var(--ds-r-md) !important; }

/* ---- 10. Fields (spec 7.5) -------------------------------------------------- */
.op-ds :is(.op-field-label, .op-readonly-label) {
    display: block; margin-bottom: 6px;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font) !important; color: var(--ds-ink-2) !important;
    text-transform: none; letter-spacing: normal;
}
.op-ds .op-form-grid > label { font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-req { color: var(--ds-danger-text); }
.op-ds .op-field-hint { margin-top: 4px; font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-3); }
.op-ds :is(.op-input, input[type="text"], input[type="number"], input[type="date"], input[type="tel"],
           input[type="email"], input[type="search"], input[type="password"], input[type="url"], input[type="time"], input:not([type]), select, textarea) {
    min-height: var(--ds-h-md); padding: 0 10px; box-sizing: border-box;
    font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink) !important;
    background-color: var(--ds-surface) !important; border: 1px solid var(--ds-field-line) !important; border-radius: var(--ds-r-md) !important;
    box-shadow: none;
}
.op-ds textarea { padding: 8px 10px; min-height: 88px; }
.op-ds :is(input, select, textarea)::placeholder { color: var(--ds-ink-3); }
.op-ds :is(input, select, textarea):hover:not(:disabled):not(:focus) { border-color: var(--ds-ink-2) !important; }
.op-ds :is(input, select, textarea):focus { border-color: var(--ds-brand) !important; box-shadow: 0 0 0 3px var(--ds-brand-100) !important; outline: none !important; }
.op-ds :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--ds-danger) !important; box-shadow: 0 0 0 3px var(--ds-danger-bg) !important; }
.op-ds :is(input, select, textarea):user-invalid { border-color: var(--ds-danger) !important; box-shadow: 0 0 0 3px var(--ds-danger-bg) !important; }
.op-ds :is(input, select, textarea):disabled { background-color: var(--ds-n-50) !important; color: var(--ds-ink-3) !important; }
.op-ds select:not([multiple]) {
    /* !important: public.css's `.op-input { background: … !important }` and the
       team table's selects reset the image with their shorthand (QA: 31 selects
       read as empty text fields). */
    appearance: none; -webkit-appearance: none; padding-inline-end: 32px !important;
    background-image: var(--ds-select-chev) !important; background-repeat: no-repeat !important;
    background-position: right 10px center !important; background-size: 16px !important;
}
[dir="rtl"] .op-ds select:not([multiple]), .op-ds[dir="rtl"] select:not([multiple]) { background-position: left 10px center !important; }
/* A disabled select keeps its chevron too (`.op-input:disabled`'s shorthand is (0,3,0)). */
.op-ds select.op-input:not([multiple]):disabled { background-image: var(--ds-select-chev) !important; background-repeat: no-repeat !important; background-size: 16px !important; background-position: right 10px center !important; }
[dir="rtl"] .op-ds select.op-input:not([multiple]):disabled { background-position: left 10px center !important; }
.op-ds input:is([type="checkbox"], [type="radio"]) {
    accent-color: var(--ds-brand); width: 16px; height: 16px; min-height: 0; padding: 0;
    border: 0 !important; box-shadow: none !important;
}
.op-ds .op-severity-mm, .op-ds .op-unit { font-size: var(--ds-fs-xs); color: var(--ds-ink-3); background: none; border: 0; }
/* Dictate: a quiet icon button under the field. */
.op-ds .op-dictate {
    min-height: var(--ds-h-sm); padding: 0 8px; border: 0 !important; background: none !important;
    color: var(--ds-icon) !important; border-radius: var(--ds-r-md); box-shadow: none;
}
.op-ds .op-dictate:hover { background: var(--ds-sunken) !important; color: var(--ds-ink) !important; }
/* "+ Add one of your own": a link on the chip row. */
.op-ds .op-field-chips {
    display: flex; flex-direction: row; flex-wrap: wrap; align-items: center;
    justify-content: flex-start; align-content: flex-start; gap: 6px;
}
.op-ds .op-field-chips > :is(.op-field-label, .op-field-hint, .op-chips-grouped, .op-note-fold, .op-field-error) { flex-basis: 100%; }
.op-ds .op-field-chips > .op-chips:not(.op-chips-grouped) { display: contents; }
.op-ds .op-field-chips > .op-chips:empty { display: none; }
.op-ds .op-field-chips > .op-addopt { display: contents; }
.op-ds .op-field-chips > .op-addopt > .op-addopt-body { flex-basis: 100%; }
/* The Objectives card's rows (fix/plan) are a two-column grid: the goal's
   name, then its chips. The general rule above unwraps .op-chips, which made
   every chip its own grid cell, one beside the name and the next under it.
   Here the chips stay one wrapping line in the second column. */
.op-ds .op-obj-row .op-field-chips > .op-chips:not(.op-chips-grouped) { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.op-ds .op-obj-row .op-field-chips > :not(.op-field-label) { grid-column: 2; }
@media (max-width: 600px) { .op-ds .op-obj-row .op-field-chips > :not(.op-field-label) { grid-column: 1; } }
.op-ds .op-addopt-open,
.op-ds .op-btn.op-addopt-open {
    border: 0 !important; background: none !important; color: var(--ds-brand) !important; box-shadow: none !important;
    padding: 0; min-height: var(--ds-h-sm); font: 500 var(--ds-fs-sm)/1 var(--ds-font);
}
.op-ds .op-btn.op-addopt-open:hover { background: none !important; color: var(--ds-brand-700) !important; }
/* The link sits under its chips and is set off from the next field below. */
.op-ds .op-addopt { margin: 2px 0 var(--ds-sp-4); }
.op-ds .op-addopt-open:hover { text-decoration: underline; }
.op-ds .op-addopt-body { background: var(--ds-n-50); border: 0; border-radius: var(--ds-r-md); padding: 12px; }
/* Field grids: 4 / 2 / 1 columns. */
.op-ds :is(.op-field-grid, .op-form-grid) { gap: var(--ds-sp-5); align-items: start; }
@media (min-width: 1024px) {
    .op-ds :is(.op-field-grid, .op-form-grid) { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
@media (min-width: 641px) and (max-width: 1023px) {
    .op-ds :is(.op-field-grid, .op-form-grid) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 640px) {
    .op-ds :is(.op-field-grid, .op-form-grid) { grid-template-columns: minmax(0, 1fr) !important; }
}
.op-ds :is(.op-field-wide, .op-form-grid-full) { grid-column: 1 / -1; }
.op-ds .op-form-grid > label, .op-ds .op-form-grid > .op-field { display: flex; flex-direction: column; gap: 6px; }

/* ---- 10b. Check tiles (spec 7.6) ---------------------------------------------- */
.op-ds .op-check-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 var(--ds-sp-5); }
.op-ds .op-check-tile {
    border: 0; background: none; padding: 6px 8px; margin-inline: -8px; min-height: var(--ds-h-md); box-shadow: none;
    border-radius: var(--ds-r-md); gap: 10px; font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink);
}
.op-ds .op-check-tile:hover { background: var(--ds-n-50); }
.op-ds .op-check-tile.is-checked { background: none; color: var(--ds-ink); font-weight: 500; border: 0; }
.op-ds .op-feature-state { font-weight: 500; color: var(--ds-ink-2); }
.op-ds .op-retention-arches .op-check-tile { border: 0; }

/* ---- 11. Buttons (spec 7.7) --------------------------------------------------- */
.op-ds .op-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: var(--ds-h-md); padding: 0 14px; box-sizing: border-box;
    border-radius: var(--ds-r-md) !important; font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font);
    letter-spacing: normal; text-transform: none; text-decoration: none !important;
    box-shadow: none !important; transform: none !important;
    background: var(--ds-surface) !important; border: 1px solid var(--ds-line-strong) !important; color: var(--ds-ink) !important;
}
.op-ds .op-btn:hover { background: var(--ds-n-50) !important; border-color: var(--ds-field-line) !important; color: var(--ds-ink) !important; }
.op-ds :is(.op-btn-primary, .op-btn-success) { background: var(--ds-brand) !important; border-color: var(--ds-brand) !important; color: var(--ds-n-0) !important; }
.op-ds :is(.op-btn-primary, .op-btn-success):hover { background: var(--ds-brand-700) !important; border-color: var(--ds-brand-700) !important; color: var(--ds-n-0) !important; }
.op-ds .op-btn-ghost { background: transparent !important; border-color: transparent !important; color: var(--ds-n-700) !important; }
.op-ds .op-btn-ghost:hover { background: var(--ds-sunken) !important; border-color: transparent !important; color: var(--ds-ink) !important; }
.op-ds .op-btn-danger { color: var(--ds-danger-text) !important; border-color: var(--ds-danger-line) !important; background: var(--ds-surface) !important; }
.op-ds .op-btn-danger:hover { background: var(--ds-danger-bg) !important; color: var(--ds-danger-text) !important; border-color: var(--ds-danger-line) !important; }
.op-ds .op-btn-small { min-height: var(--ds-h-sm); padding: 0 10px; font-size: var(--ds-fs-sm); line-height: var(--ds-lh-sm); }
.op-ds :is(.op-btn-icon, .op-icon-btn) {
    width: var(--ds-h-md); min-width: var(--ds-h-md); height: var(--ds-h-md); padding: 0; justify-content: center;
    border-color: transparent !important; background: transparent !important; color: var(--ds-icon) !important;
}
.op-ds :is(.op-btn-icon, .op-icon-btn):hover { background: var(--ds-sunken) !important; color: var(--ds-ink) !important; }
.op-ds :is(.op-btn.op-btn-text, .op-btn-link, .op-link-btn, .op-modify, .op-lab-remove, .op-goto-step:not(.op-btn-primary)) {
    display: inline-flex; align-items: center; gap: 4px;
    background: none !important; border: 0 !important; box-shadow: none !important;
    /* The word is 18 px; the hit area is 32 (no tap target below 32, assert-mobile). */
    padding: 7px 2px; margin-block: -7px; min-height: 0; color: var(--ds-brand) !important;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); text-decoration: none;
}
.op-ds :is(.op-btn.op-btn-text, .op-btn-link, .op-link-btn, .op-modify, .op-lab-remove, .op-goto-step:not(.op-btn-primary)):hover {
    background: none !important; color: var(--ds-brand-700) !important; text-decoration: underline !important;
}
.op-ds .op-btn .op-btn-text { padding: 0; font: inherit; color: inherit !important; text-decoration: none !important; }
.op-ds :is(.op-btn, .op-chip)[disabled], .op-ds :is(.op-btn, .op-chip)[aria-disabled="true"] { opacity: .5; }
.op-ds .op-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: var(--ds-sp-5); }
/* A save inside a card ends where the card's content ends (Clinic's ended 24 px short of "Collect now"). */
.op-ds .op-card .op-clinical-form > .op-form-actions { padding-inline: 0; }
/* "+ Add a clinic" lines up with the select, not its label. */
.op-ds .op-form-grid > .op-form-grid-end { align-self: end; }
/* The Modify link (spec 7.8): the word, 13 px, in the brand. No box, no "↳". */
.op-ds .op-modify::before { content: none; }
/* The floating "?" help: a white circle, not teal. */
.op-ds .op-help-fab {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%; font-size: 0;
    background: var(--ds-surface) !important; border: 1px solid var(--ds-line-strong) !important;
    color: var(--ds-n-700) !important; box-shadow: var(--ds-shadow); transform: none;
}
.op-ds .op-help-fab::before {
    content: ''; width: 20px; height: 20px; background: currentColor;
    -webkit-mask: var(--op-ic-help) center / contain no-repeat; mask: var(--op-ic-help) center / contain no-repeat;
}
.op-ds .op-help-fab:hover { transform: none; box-shadow: var(--ds-shadow); }

/* ---- 12. Derived values ("from an earlier step", spec 7.9) ---------------------
   No dashed box, no tint, no "↳", no capitals: a quiet line saying where it
   comes from and a Modify link. */
.op-ds .op-card:is(.op-summary-card, .op-derived, .op-fsec-derived) { background: var(--ds-surface); border: 1px solid var(--ds-line); box-shadow: none; }
.op-ds .op-card:is(.op-derived, .op-fsec-derived) { padding: 16px 20px; }
.op-ds .op-card.op-fsec-derived > .op-fsec-head:first-child { margin-bottom: 12px; gap: 4px 10px; }
.op-ds .op-card.op-fsec-derived .op-fsec-title { flex: 0 1 auto; font-size: var(--ds-fs-md); line-height: var(--ds-lh-md); }
.op-ds .op-card.op-fsec-derived .op-fsec-sub { flex-basis: auto; order: 1; font-size: var(--ds-fs-xs); line-height: var(--ds-lh-xs); color: var(--ds-ink-3); }
/* Adjacent derived cards are one block (the three at the top of Clinical Steps). */
.op-ds .op-card.op-fsec-derived + .op-card.op-fsec-derived {
    margin-top: calc(-1 * var(--ds-sp-4) - 1px); border-top-left-radius: 0; border-top-right-radius: 0;
}
.op-ds .op-card.op-fsec-derived:has(+ .op-card.op-fsec-derived) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.op-ds .op-linked-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--ds-sp-3) var(--ds-sp-5);
    background: none; border: 0; border-radius: 0; padding: 0; overflow: visible;
}
.op-ds .op-linked-card { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.op-ds .op-linked-card.is-empty { opacity: 1; }
/* A Modify inside a linked card sits under the value (spec 7.9), not floated
   beside a label squeezed by op-components.css's 84 px gutter. */
.op-ds .op-linked-card.has-modify { padding-inline-end: 0; }
.op-ds .op-linked-card .op-modify { position: static; display: inline-flex; margin-top: 4px; min-height: 0; }
.op-ds .op-linked-label {
    display: block; font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font) !important;
    color: var(--ds-ink-2); text-transform: none; letter-spacing: normal;
}
.op-ds .op-linked-value { font: 500 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-linked-card.is-empty .op-linked-value { font-weight: 400; font-style: normal; color: var(--ds-ink-3); }
.op-ds :is(.op-linked-inline, .op-extraction-echo) { border: 0; background: none; padding: 0; border-radius: 0; font-size: var(--ds-fs-sm); color: var(--ds-ink-2); }
/* The summary cards (Diagnosis, Treatment plan): white, solid, one line when empty. */
.op-ds .op-summary-card { padding: 14px 20px; }
.op-ds .op-summary-block { background: none; border: 0; padding: 0; margin: 0; border-radius: 0; }
.op-ds .op-summary-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.op-ds .op-summary-title { font: 600 var(--ds-fs-lg)/var(--ds-lh-lg) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-summary-tag {
    background: none !important; border: 0 !important; padding: 0 !important; border-radius: 0;
    font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font) !important; color: var(--ds-ink-3) !important;
    text-transform: none !important; letter-spacing: normal !important;
}
.op-ds .op-summary-card .op-skip-note { display: none; }
.op-ds .op-summary-card .op-summary-block > .op-muted { margin: 2px 0 0; font-size: var(--ds-fs-sm); color: var(--ds-ink-3); }
.op-ds .op-summary-card .op-summary-block > .op-muted em { font-style: normal; }
.op-ds .op-summary-card:not(:has(.op-summary-list)) .op-summary-block { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.op-ds .op-summary-card:not(:has(.op-summary-list)) .op-summary-block > p { margin: 0; color: var(--ds-ink-3); }
/* A filled Treatment plan summary starts folded to one line: the title, its
   tag and the plan's sentence; the chevron opens every row. */
.op-ds .op-summary-fold > summary.op-summary-head {
    display: flex; flex-wrap: nowrap; align-items: baseline; gap: 4px 10px; cursor: pointer; list-style: none;
    min-height: 24px; padding-inline-end: 28px; position: relative;
}
.op-ds .op-summary-fold > summary::-webkit-details-marker { display: none; }
.op-ds .op-summary-fold > summary::after {
    content: ''; position: absolute; inset-inline-end: 0; top: 4px; width: 16px; height: 16px; background: var(--ds-icon);
    -webkit-mask: var(--op-ic-chev-down) center / contain no-repeat; mask: var(--op-ic-chev-down) center / contain no-repeat;
    transform: rotate(-90deg); transition: transform var(--ds-ease);
}
[dir="rtl"] .op-ds .op-summary-fold > summary::after { transform: rotate(90deg); }
.op-ds .op-summary-fold[open] > summary::after { transform: none; }
.op-ds .op-summary-fold > summary > :is(.op-summary-title, .op-summary-tag) { flex: none; }
.op-ds .op-summary-fold .op-plan-headline {
    flex: 1 1 0; min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); unicode-bidi: plaintext; text-align: start;
}
.op-ds .op-summary-fold[open] > summary { flex-wrap: wrap; margin-bottom: var(--ds-sp-3); }
.op-ds .op-summary-fold[open] .op-plan-headline { flex-basis: 100%; white-space: normal; }
/* The ellipsis on the words' own box, so nothing measures past the card. */
.op-ds .op-summary-fold .op-plan-headline > bdi { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-ds .op-summary-fold[open] .op-plan-headline > bdi { white-space: normal; }
.op-ds .op-summary-row { display: grid; grid-template-columns: 11em minmax(0, 1fr); gap: 12px; padding-block: 4px; border-bottom-style: solid; border-bottom-color: var(--ds-line); }
.op-ds .op-summary-row dt { font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-summary-row dd { margin: 0; font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
@media (min-width: 1024px) {
    .op-ds .op-summary-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
}
.op-ds .op-pillar-row { border: 0 !important; padding-inline-start: 0 !important; }
.op-ds .op-toned-success, .op-ds .op-toned-danger, .op-ds .op-toned-info { border-inline-start-color: var(--ds-line); }
/* A consent that asks for a new signature: the warning box inside says so; the card keeps a plain edge. */
.op-ds .op-consent-card.is-outdated { border-inline-start: 1px solid var(--ds-line); }

/* ---- 13. Badges, pills, counts (spec 7.10) --------------------------------------- */
.op-ds :is(.op-badge, .op-pill, .op-plan-badge, .op-case-badge, .op-lab-status, .op-bs-badge, .op-late,
           .op-plan-version-tag, .op-stage-status, .op-lab-flag, .op-refine-tag) {
    display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; max-width: 100%; box-sizing: border-box;
    border: 0; border-radius: var(--ds-r-sm); background: var(--ds-sunken); color: var(--ds-n-700);
    font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); text-transform: none; letter-spacing: normal; white-space: nowrap;
    box-shadow: none;
}
.op-ds :is(.op-badge[class*="op-color-"], .op-pill-paid, .op-pill-done, .op-pill-booked, .op-pill-owed, .op-pill-new,
           .op-pill-consult, .op-lab-status, .op-case-badge:not(.is-more), .op-bs-badge[class*="-badge-"], .op-late,
           .op-stage-status, .op-lab-flag, .op-badge.is-danger, .op-badge.is-new, .op-consult-tag)::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--dot, var(--ds-n-400));
}
.op-ds .op-badge.op-color-gray { --dot: var(--ds-n-400); }
.op-ds .op-badge.op-color-teal { --dot: var(--ds-brand); }
.op-ds .op-badge:is(.op-color-blue, .op-color-purple, .op-color-coral, .op-color-orange) { --dot: var(--ds-info); }
.op-ds .op-badge.op-color-amber { --dot: var(--ds-warning); }
.op-ds .op-badge.op-color-green { --dot: var(--ds-success); }
.op-ds :is(.op-badge.op-color-red, .op-badge.is-danger, .op-pill-owed, .op-late.is-late) {
    background: var(--ds-danger-bg); color: var(--ds-danger-text); --dot: var(--ds-danger);
}
.op-ds :is(.op-pill-paid, .op-pill-done, .op-pill-booked) { --dot: var(--ds-success); }
.op-ds .op-pill-new, .op-ds .op-badge.is-new { --dot: var(--ds-brand); }
.op-ds .op-pill-consult, .op-ds .op-consult-tag { --dot: var(--ds-info); }
.op-ds .op-refine-tag { margin-inline-start: 6px; vertical-align: middle; }
/* An icon before words in an inline-flex link keeps its gap (the space between them collapses). */
.op-ds .op-agenda-money-link { gap: 6px; }
.op-ds .op-back-link { gap: 4px; }
.op-ds .op-lab-status.is-sent { --dot: var(--ds-info); }
.op-ds .op-lab-status.is-received { --dot: var(--ds-success); }
.op-ds .op-lab-status.is-not { --dot: var(--ds-warning); }
.op-ds .op-late.is-on-time { --dot: var(--ds-success); }
/* Under a narrow table cell's value: a caption line with its dot, not a box wrapping word by word. */
.op-ds .op-lab-flag { --dot: var(--ds-warning); display: block; height: auto; padding: 0; margin-top: 2px; background: none; color: var(--ds-warning-text); white-space: normal; }
.op-ds .op-lab-flag::before { display: inline-block; margin-inline-end: 6px; vertical-align: 1px; }
.op-ds .op-stage-status { --dot: var(--ds-n-400); }
.op-ds .op-pill-private::before {
    content: ''; width: 12px; height: 12px; flex: none; background: var(--ds-danger);
    -webkit-mask: var(--op-ic-lock) center / contain no-repeat; mask: var(--op-ic-lock) center / contain no-repeat;
}
.op-ds .op-bs-badge-success { --dot: var(--ds-success); }
.op-ds .op-bs-badge-warn { --dot: var(--ds-warning); }
.op-ds .op-bs-badge-danger { --dot: var(--ds-danger); }
/* My cases: the badge is one text block that wraps, not three flex columns. */
.op-ds .op-case-badge {
    display: inline-block; height: auto; padding: 3px 8px; white-space: normal; line-height: 16px;
}
.op-ds .op-case-badge::before { display: inline-block; margin-inline-end: 6px; vertical-align: 1px; }
.op-ds .op-case-badge:is(.is-lab, .is-info) { --dot: var(--ds-info); }
.op-ds .op-case-badge.is-pending { --dot: var(--ds-warning); }
.op-ds .op-case-badge.is-overdue { --dot: var(--ds-danger); }
/* One neutral shape for every card badge (spec 4.2: "badge, dot info / warning
   / danger"): op-money.css tinted them blue, amber and pink at (0,3,0), and a
   wrapped pink badge filled a 40 px block on the landing screen. */
.op-ds .op-case-badges .op-case-badge:is(.is-lab, .is-info, .is-pending, .is-overdue) {
    background: var(--ds-sunken); color: var(--ds-n-700); border: 0;
}
.op-ds .op-case-badges .op-case-badge.is-more { background: none; color: var(--ds-ink-2); border: 0; padding-inline: 2px; }
.op-ds .op-case-badge > span[aria-hidden="true"]:first-child { display: none; }
.op-ds .op-case-badge .op-case-badge-teeth { color: var(--ds-ink); font-weight: 500; }
/* Counts. Unread counts are the one solid teal besides the primary button. */
.op-ds :is(.op-tab-count, .op-clinic-tab-count, .op-dock-tab-count, .op-case-filter-count, .op-count) {
    display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; border: 0;
    background: var(--ds-sunken); color: var(--ds-n-700); font: 500 var(--ds-fs-xs)/18px var(--ds-font);
}
.op-ds :is(.op-bell-count, .op-tool-badge) { background: var(--ds-brand); color: var(--ds-n-0); border: 0; box-shadow: none; }
/* The admin sidebar's "needs you" count is unread: brand fill, white figure
   (the legacy rule painted --op-accent, which the calm look re-points to a grey
   line: white on #c9d1d6 read 1.55:1). */
.op-ds .op-side-badge {
    display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
    min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; border: 0;
    background: var(--ds-brand); color: var(--ds-n-0); font: 600 var(--ds-fs-xs)/18px var(--ds-font);
}

/* ---- 14. Alerts and notices (spec 7.11) ----------------------------------------- */
.op-ds .op-alert {
    display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
    background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-md);
    color: var(--ds-ink); font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); box-shadow: none;
}
.op-ds .op-alert::before {
    content: ''; flex: none; width: 16px; height: 16px; margin-top: 1px; background: var(--ds-info);
    -webkit-mask: var(--op-ic-info) center / contain no-repeat; mask: var(--op-ic-info) center / contain no-repeat;
}
.op-ds .op-alert-success::before { background: var(--ds-success); -webkit-mask-image: var(--op-ic-check); mask-image: var(--op-ic-check); }
.op-ds .op-alert-warning::before { background: var(--ds-warning); -webkit-mask-image: var(--op-ic-warning); mask-image: var(--op-ic-warning); }
.op-ds .op-alert-error::before { background: var(--ds-danger); -webkit-mask-image: var(--op-ic-warning); mask-image: var(--op-ic-warning); }
.op-ds :is(.op-alert-info, .op-alert-success, .op-alert-warning) { background: var(--ds-surface); border-color: var(--ds-line); color: var(--ds-ink); }
.op-ds .op-alert-error { background: var(--ds-surface); border-color: var(--ds-line); color: var(--ds-danger-text); }
.op-ds :is(.op-lock-note, .op-ro-note)::before { background: var(--ds-icon); -webkit-mask-image: var(--op-ic-lock); mask-image: var(--op-ic-lock); }

/* ---- 15. Tables (spec 7.12) --------------------------------------------------- */
.op-ds :is(.op-table, .op-users-table, .op-info-table) {
    border-collapse: collapse; width: 100%; font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); box-shadow: none;
}
.op-ds :is(.op-table, .op-users-table, .op-info-table) th {
    font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); text-transform: none; letter-spacing: normal;
    text-align: start; padding: 8px 12px; border-bottom: 1px solid var(--ds-line-strong); background: none;
}
.op-ds :is(.op-table, .op-users-table, .op-info-table) td { padding: 10px 12px; border-bottom: 1px solid var(--ds-line); vertical-align: top; background: none; }
.op-ds :is(.op-table, .op-users-table, .op-info-table) tbody tr { background: none; box-shadow: none; }
.op-ds :is(.op-table, .op-users-table, .op-info-table) tbody tr:hover > td { background: var(--ds-n-50); }
.op-ds :is(.op-table, .op-users-table, .op-info-table) :is(td, th).op-num { text-align: end; white-space: nowrap; }
.op-ds :is(.op-table, .op-users-table) tr:is(.is-late, .is-overdue, .op-row-late) > td { background: none; }
.op-ds .op-table-wrap { border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); background: var(--ds-surface); box-shadow: none; }
/* Inside a card, a table is not a box in the box. */
.op-ds .op-card .op-table-wrap { border: 0; border-radius: 0; background: none; }
.op-ds :is(.op-money-amount, .op-due-amount, .op-stat-value, .op-pay-card strong, td.op-num) { white-space: nowrap; }
@media (max-width: 640px) {
    .op-ds td[data-label]::before { font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); text-transform: none; letter-spacing: normal; }
}
/* A tool outside the chart is an 8 px dot; its name is ink. */
.op-ds .op-mech-line strong { color: var(--ds-ink); }

/* ---- 16. Stat rows: money tiles and KPIs (spec 7.13) --------------------------- */
.op-ds :is(.op-pay-cards, .op-pay-summary, .op-stat-row, .op-stats, .op-kpi-grid, .op-money-tiles) {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0;
    background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: none;
}
/* Inside a card the stat row is a row of the card, not a second box. */
.op-ds .op-card :is(.op-pay-cards, .op-pay-summary, .op-stat-row, .op-stats, .op-money-tiles) { border: 0; border-radius: 0; background: none; }
.op-ds .op-card :is(.op-pay-cards, .op-pay-summary, .op-stat-row, .op-stats, .op-money-tiles) > :first-child { padding-inline-start: 0; }
.op-ds :is(.op-pay-card, .op-stat, .op-kpi-card) {
    background: none; border: 0; border-radius: 0; box-shadow: none; padding: 12px 16px; transform: none;
    border-inline-start: 1px solid var(--ds-line);
}
.op-ds :is(.op-pay-card, .op-stat, .op-kpi-card):first-child { border-inline-start: 0; }
.op-ds :is(.op-pay-label, .op-stat-label, .op-kpi-label) {
    font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); text-transform: none; letter-spacing: normal;
}
.op-ds :is(.op-pay-card strong, .op-pay-amount, .op-stat-value, .op-kpi-value) { font: 600 var(--ds-fs-xl)/var(--ds-lh-xl) var(--ds-font); color: var(--ds-ink); white-space: nowrap; }
.op-ds .op-kpi-value { font-size: var(--ds-fs-2xl); line-height: var(--ds-lh-2xl); }
.op-ds :is(.op-pay-card, .op-stat):is(.is-overdue, .op-stat-danger) :is(strong, .op-stat-value, .op-pay-amount) { color: var(--ds-danger-text); }
.op-ds .op-stat-sub { font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-3); }
@media (max-width: 640px) { .op-ds .op-stat-sub { flex-basis: 100%; min-width: 0; } }
.op-ds :is(.op-stat-warning, .op-stat-success, .op-stat-danger, .op-pay-card.is-overdue) { background: none; border-color: var(--ds-line); }
.op-ds .op-kpi-icon { display: none; }
@media (max-width: 640px) {
    .op-ds :is(.op-pay-cards, .op-pay-summary, .op-stat-row, .op-stats, .op-kpi-grid, .op-money-tiles) { grid-template-columns: minmax(0, 1fr); }
    .op-ds :is(.op-pay-card, .op-stat, .op-kpi-card) {
        display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 12px; min-width: 0;
        border-inline-start: 0; border-top: 1px solid var(--ds-line);
    }
    .op-ds :is(.op-pay-card, .op-stat, .op-kpi-card):first-child { border-top: 0; }
}

/* ---- 17. Tabs: filters, money, settings, team, sign-in, dock (spec 7.14) ------- */
.op-ds :is(.op-case-filter, .op-money-tabs, .op-tab-pills, .op-auth-tabs, .op-dock-tabs) {
    display: flex; flex-wrap: nowrap; gap: 4px 20px; padding: 0;
    border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0; background: none; box-shadow: none;
    overflow-x: auto; scrollbar-width: thin;
}
.op-ds :is(.op-case-filter .op-chip, .op-money-tabs .op-tab-link, .op-tab-pill, .op-auth-tabs a, .op-dock-tabbtn) {
    display: inline-flex; align-items: center; gap: 6px; flex: none;
    min-height: 40px; padding: 0 2px; margin-bottom: -1px; box-sizing: border-box; white-space: nowrap;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font) !important; color: var(--ds-ink-2) !important;
    background: none !important; border: 0 !important; border-bottom: 2px solid transparent !important;
    border-radius: 0 !important; box-shadow: none !important; text-decoration: none !important;
}
.op-ds :is(.op-case-filter .op-chip, .op-money-tabs .op-tab-link, .op-tab-pill, .op-auth-tabs a, .op-dock-tabbtn):hover { color: var(--ds-ink) !important; background: none !important; }
.op-ds :is(.op-case-filter .op-chip, .op-money-tabs .op-tab-link, .op-tab-pill, .op-auth-tabs a, .op-dock-tabbtn):is(.is-active, .active, [aria-selected="true"]) {
    color: var(--ds-brand-700) !important; border-bottom-color: var(--ds-brand) !important; font-weight: 600 !important; background: none !important;
}
.op-ds .op-case-filter .op-chip::before { content: none; }

/* ---- 18. Modals, panels, popovers, toasts, empty states (spec 7.15) ------------ */
.op-ds .op-modal-content, .op-ds.op-modal .op-modal-content {
    background: var(--ds-surface) !important; border: 0; border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow); padding: 24px;
}
.op-ds .op-modal-backdrop { background: var(--ds-scrim); backdrop-filter: none; -webkit-backdrop-filter: none; }
.op-ds .op-modal-content h2, .op-ds .op-modal-content h3 { font: 600 var(--ds-fs-xl)/var(--ds-lh-xl) var(--ds-font); }
.op-ds .op-modal-close { background: none !important; border-radius: var(--ds-r-md); color: var(--ds-icon) !important; }
.op-ds .op-modal-close:hover { background: var(--ds-sunken) !important; }
.op-ds .op-path-opt {
    border: 1px solid var(--ds-line); border-radius: var(--ds-r-md); padding: 12px 14px; background: var(--ds-surface); box-shadow: none;
}
.op-ds .op-path-opt:is(.is-active, .is-selected, :has(input:checked)) { border-color: var(--ds-brand); background: var(--ds-brand-50); }
/* Notes and Messages: one side panel at the inline end, above the bar. */
.op-ds :is(.op-notes-panel, .op-msg-panel) {
    position: fixed; inset-inline-end: 16px; inset-inline-start: auto;
    inset-block-end: calc(var(--ds-bar-h) + 12px); width: min(380px, 100vw - 24px); max-height: min(560px, 70vh);
    background: var(--ds-surface) !important; border: 1px solid var(--ds-line) !important;
    border-radius: var(--ds-r-lg) !important; box-shadow: var(--ds-shadow) !important;
}
@media (max-width: 640px) {
    .op-ds :is(.op-notes-panel, .op-msg-panel) { inset-inline: 12px; width: auto; }
}
.op-ds :is(.op-notif-panel, .op-bell-panel) {
    background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow); padding: 8px;
}
body:has(.op-ds) .op-toast {
    background: var(--ds-n-800); color: var(--ds-n-0); border-radius: var(--ds-r-md); box-shadow: var(--ds-shadow);
    padding: 10px 14px; font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font);
    display: flex; align-items: center; gap: 10px;
}
body:has(.op-ds) .op-toast::before {
    content: ''; flex: none; width: 16px; height: 16px; background: var(--ds-info);
    -webkit-mask: var(--op-ic-info) center / contain no-repeat; mask: var(--op-ic-info) center / contain no-repeat;
}
body:has(.op-ds) .op-toast.success::before { background: var(--ds-on-dark-success); -webkit-mask-image: var(--op-ic-check); mask-image: var(--op-ic-check); }
body:has(.op-ds) .op-toast:is(.error, .warning)::before { background: var(--ds-on-dark-warning); -webkit-mask-image: var(--op-ic-warning); mask-image: var(--op-ic-warning); }
body:has(.op-ds) .op-toast.error::before { background: var(--ds-on-dark-danger); }
.op-ds .op-empty { padding: 32px 16px; text-align: center; color: var(--ds-ink-2); font-size: var(--ds-fs-sm); }
.op-ds .op-empty-icon { display: none; }
.op-ds .op-tour-icon { display: none; }

/* ---- 19. The context row: journey, notices, photos (spec 8.4) ------------------- */
.op-ds .op-workarea {
    display: flex; flex-wrap: wrap; align-items: flex-start; align-content: flex-start;
    column-gap: var(--ds-sp-5); row-gap: var(--ds-sp-2);
}
.op-ds .op-workarea > * { flex: 0 0 100%; min-width: 0; }
.op-ds .op-workarea > :is(.op-jline, #op-case-alerts) { flex: 0 0 auto; }
.op-ds .op-workarea > .op-photo-rail { flex: 1 1 320px; }
.op-ds .op-workarea > .op-step-index { margin-top: var(--ds-sp-1); }
/* The journey line: dots and a percentage, no pill. */
.op-ds .op-jline, .op-ds .op-workarea > .op-jline {
    border: 0; background: none; padding: 0; margin: 0; min-height: 32px; gap: 10px; width: auto; box-shadow: none; box-sizing: border-box;
}
.op-ds .op-jline:hover { border: 0; }
.op-ds .op-jline:hover .op-jline-stage { text-decoration: underline; }
.op-ds .op-jline-dot {
    width: 10px; height: 10px; font-size: 0; border: 0; background: var(--ds-n-300); box-shadow: none; color: transparent;
}
.op-ds .op-jline-node.is-completed .op-jline-dot { background: var(--ds-brand); }
.op-ds .op-jline-node.is-current .op-jline-dot { background: var(--ds-surface); box-shadow: inset 0 0 0 2px var(--ds-brand); }
.op-ds .op-jline-node + .op-jline-node::before { width: 10px; height: 1px; background: var(--ds-line-strong); }
.op-ds .op-jline-node.is-completed + .op-jline-node::before { background: var(--ds-brand); }
.op-ds .op-jline-pct { font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); }
/* The stage is never cut (a mixed-script line must not take an ellipsis, spec 10.1). */
.op-ds .op-jline-stage,
.op-ds .op-workarea > .op-jline .op-jline-stage { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); max-width: none; overflow: visible; text-overflow: clip; }
.op-ds .op-jline-text { font-size: var(--ds-fs-sm); }
/* The notices: one collapsible line instead of a banner per item. */
.op-ds .op-case-notices { position: relative; margin: 0; }
.op-ds .op-case-notices-sum {
    display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; box-sizing: border-box;
    border-radius: var(--ds-r-md); cursor: pointer; list-style: none; white-space: nowrap;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink);
}
.op-ds .op-case-notices-sum::-webkit-details-marker { display: none; }
.op-ds .op-case-notices-sum:hover { background: var(--ds-sunken); }
.op-ds .op-case-notices-sum > .op-ic:first-child { color: var(--ds-icon); }
.op-ds .op-case-notices-chev { transition: transform var(--ds-ease); color: var(--ds-icon); }
.op-ds .op-case-notices-new[hidden] { display: none; }
.op-ds .op-case-notices[open] .op-case-notices-chev { transform: rotate(180deg); }
.op-ds .op-case-notices-panel {
    position: absolute; z-index: 42; top: calc(100% + 4px); inset-inline-start: 0;
    width: min(520px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; box-sizing: border-box;
    padding: 8px; background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow);
}
.op-ds .op-case-notices-title { margin: 8px 4px 4px; font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-3); }
.op-ds .op-case-notices-list { list-style: none; margin: 0; padding: 0; }
.op-ds .op-case-notices .op-case-alert {
    display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 8px 4px;
    background: none; border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0; box-shadow: none;
    font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink);
}
.op-ds .op-case-notices .op-case-alert:last-child { border-bottom: 0; }
.op-ds .op-case-notices .op-case-alert > .op-ic { margin-top: 2px; color: var(--ds-icon); }
.op-ds .op-case-notices .op-case-alert-body { flex: 1; min-width: 0; }
.op-ds .op-case-notices .op-case-alert-body strong { font-weight: 500; }
.op-ds .op-case-notices .op-case-alert-body .op-muted { display: block; font-size: var(--ds-fs-sm); color: var(--ds-ink-2); }
.op-ds .op-case-notices .op-case-alert-pending strong { font-weight: 400; }
.op-ds .op-case-notices .op-case-alert-pending::before {
    content: ''; flex: none; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; background: var(--ds-n-400);
}
.op-ds .op-case-notices .op-case-alert-pending.is-overdue::before { background: var(--ds-danger); }
.op-ds .op-case-notices .op-case-alert-close {
    flex: none; width: 32px; height: 32px; margin: -6px 0; padding: 0; display: inline-flex; align-items: center; justify-content: center;
    border: 0; background: none; border-radius: var(--ds-r-md); color: var(--ds-icon); cursor: pointer;
}
.op-ds .op-case-notices .op-case-alert-close:hover { background: var(--ds-sunken); color: var(--ds-ink); }
/* On Follow-up the step has its own pending list: the panel shows the news only. */
.op-ds[data-active-step="followup"] #op-case-alerts :is(.op-case-notices-list, .op-case-notices-title, .op-case-notices-pending, .op-case-notices-overdue) { display: none; }
.op-ds[data-active-step="followup"] #op-case-alerts:not(:has(.op-case-alert:not(.op-case-alert-pending))) { display: none; }
/* The photo rail: one line, no card. */
.op-ds .op-photo-rail { background: none; border: 0; box-shadow: none; padding: 0; border-radius: 0; margin: 0; }
.op-ds .op-photo-rail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 0; background: none; border: 0; }
.op-ds .op-photo-rail-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 8px; border: 0; background: none;
    border-radius: var(--ds-r-md); color: var(--ds-ink); font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); cursor: pointer;
}
.op-ds .op-photo-rail-toggle:hover { background: var(--ds-sunken); }
.op-ds .op-photo-rail-title { display: inline-flex; align-items: center; gap: 8px; font: inherit; color: inherit; }
.op-ds .op-photo-rail-title > .op-ic { color: var(--ds-icon); }
.op-ds .op-photo-rail-count { font-weight: 400; color: var(--ds-ink-3); }
.op-ds .op-photo-rail-chev { color: var(--ds-icon); font-size: 0; }
.op-ds .op-photo-rail-chev > .op-ic { transition: transform var(--ds-ease); }
.op-ds .op-photo-rail.is-folded .op-photo-rail-chev > .op-ic, .op-ds.op-rail-folded .op-photo-rail-chev > .op-ic { transform: rotate(180deg); }
.op-ds .op-rail-tabs { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 0; margin: 0; }
.op-ds .op-rail-tabs-label { display: inline-flex; align-items: center; gap: 6px; margin-inline: 8px 2px; font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-rail-tab {
    display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 8px;
    border: 0 !important; background: none !important; box-shadow: none !important; border-radius: var(--ds-r-md) !important;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-brand) !important;
}
.op-ds .op-rail-tab:hover { background: var(--ds-sunken) !important; }
.op-ds .op-rail-tabs > .op-rail-tab-phone { display: none; }
.op-ds .op-photo-rail-strip { gap: 8px; padding: 8px 0 0; background: none; border: 0; }
.op-ds .op-rail-item { width: 64px; }
.op-ds .op-rail-shot { width: 64px; height: 48px; border: 0; border-radius: var(--ds-r-sm); background: var(--ds-n-50); overflow: hidden; }
.op-ds .op-rail-cap { font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-3); unicode-bidi: plaintext; text-align: start; }
.op-ds .op-rail-item.is-empty .op-rail-shot { border: 0; background: var(--ds-n-50); }
.op-ds .op-rail-empty { font-size: var(--ds-fs-xs); color: var(--ds-ink-3); }
@media (min-width: 1280px) {
    /* The lane shows these photos already: the rail is its head only. */
    .op-ds.op-app.op-has-dock .op-photo-rail-strip, .op-ds.op-app.op-has-dock .op-photo-rail-chev { display: none; }
}
@media (max-width: 640px) {
    .op-ds .op-photo-rail-strip { display: none; }
}

/* ---- 20. The bottom bar, Notes and the floating Save (spec 8.7) ---------------- */
.op-ds .op-wizard-foot {
    position: sticky; bottom: 0;
    margin: var(--ds-sp-5) calc(-1 * var(--ds-gutter)) 0; padding: 10px var(--ds-gutter); min-height: var(--ds-bar-h); box-sizing: border-box;
    background: var(--ds-surface); border: 0; border-top: 1px solid var(--ds-line); border-radius: 0; box-shadow: none;
}
@media (min-width: 1280px) {
    /* The bar stops where the photo lane or the kept-open dock begins: they
       run down to the bottom of the screen beside it. */
    .op-ds.op-app:is(.op-has-dock, .op-dock-pinned) .op-wizard-foot { margin-inline-end: 0; }
    .op-ds.op-app .op-wizard-count { display: none; }
}
.op-ds .op-wizard-prev { color: var(--ds-ink-2) !important; font-size: var(--ds-fs-sm); font-weight: 500; }
.op-ds .op-wizard-next .op-btn-text { display: inline-block; max-width: 22ch; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-ds .op-wizard-next { min-width: 0; }
.op-ds .op-wizard-arrow { display: inline-flex; }
.op-ds .op-wizard-count { font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-3); }
.op-ds .op-wizard-tools { display: flex; align-items: center; gap: 2px; }
.op-ds :is(.op-tool-btn, .op-wizard-tools .op-notes-fab) {
    position: static; display: inline-flex; align-items: center; gap: 8px; box-sizing: border-box;
    min-height: var(--ds-h-md); padding: 0 10px; inset: auto; transform: none;
    border: 0 !important; background: none !important; box-shadow: none !important; border-radius: var(--ds-r-md) !important;
    color: var(--ds-n-700) !important; font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); white-space: nowrap; cursor: pointer;
}
.op-ds :is(.op-tool-btn, .op-wizard-tools .op-notes-fab):hover { background: var(--ds-sunken) !important; color: var(--ds-ink) !important; transform: none; }
.op-ds :is(.op-tool-btn[aria-expanded="true"], .op-tool-messages.is-open, .op-notes-fab.is-open) {
    background: var(--ds-sunken) !important; color: var(--ds-brand-700) !important;
}
.op-ds .op-tool-btn > .op-ic, .op-ds .op-notes-fab > .op-ic { color: var(--ds-icon); }
.op-ds :is(.op-tool-btn[aria-expanded="true"], .op-notes-fab.is-open) > .op-ic { color: var(--ds-brand-700); }
.op-ds .op-tool-badge { position: static; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; font: 600 var(--ds-fs-xs)/18px var(--ds-font); }
.op-ds .op-notes-fab .op-tool-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ds-brand); box-shadow: none; border: 0; }
.op-ds .op-notes-fab-text, .op-ds .op-tool-text { font: inherit; }
/* The "More" wrapper exists for the phone; above it, nothing changes. */
.op-ds .op-wizard-more, .op-ds .op-wizard-more-menu { display: contents; }
.op-ds .op-wizard-tools :is(.op-wizard-more-btn, .op-tool-photos) { display: none; }
/* The floating Save. */
.op-ds .op-float-save {
    position: fixed; z-index: 44;
    inset-block-end: calc(var(--op-wizard-h, 60px) + 12px);
    inset-inline-end: calc(var(--ds-gutter) + 8px);
    display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 14px;
    background: var(--ds-surface); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-lg);
    box-shadow: var(--ds-shadow);
}
[dir="rtl"] .op-ds .op-float-save { padding: 6px 14px 6px 6px; }
.op-ds .op-float-save[hidden] { display: none; }
.op-ds .op-float-save-note { font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); white-space: nowrap; }
.op-ds .op-float-save .op-btn { min-height: var(--ds-h-sm); padding: 0 10px; font-size: var(--ds-fs-sm); }
@media (min-width: 1280px) {
    .op-ds.op-app.op-has-dock .op-float-save { inset-inline-end: calc(var(--op-lane-w, 56px) + 36px); }
}
@media (min-width: 1440px) {
    .op-ds.op-app.op-dock-pinned .op-float-save { inset-inline-end: calc(var(--op-dock-w, 400px) + 28px); }
}
/* Room under the last field, so the floating bar never sits on it — kept
   whether the bar shows or not (pln_smoke 5: given only while it showed, the
   page lost 64 px of scroll and jumped under the doctor's pointer). */
.op-ds .op-tab-panel.active { padding-bottom: 64px; }
/* The app root's own 64 px foot lifted the sticky bar off the screen's edge at
   the end of every step (a strip of canvas under a "full-bleed" bar); the
   breathing room is the step's, above. */
body.orthoplan-fullscreen .op-frontend.op-ds.op-app, .op-ds.op-app { padding-bottom: 0; }
@media (max-width: 640px) {
    .op-ds .op-float-save { inset-inline-start: 12px; inset-inline-end: 12px; justify-content: space-between; }
}

/* ---- 21. The photo dock (spec 8.8) --------------------------------------------- */
.op-ds .op-dock-tab {
    border: 1px solid var(--ds-line) !important; background: var(--ds-surface) !important; box-shadow: none !important;
    color: var(--ds-ink-2); border-radius: var(--ds-r-md);
}
.op-ds .op-dock-tab-icon { color: var(--ds-icon); }
/* Open: the "open tool" tint (op-shell.css painted the 3.0 teal tab's words white). */
.op-ds .op-dock-tab[aria-expanded="true"],
.op-ds #op-photos-fab.op-dock-tab[aria-expanded="true"] {
    background: var(--ds-brand-50) !important; color: var(--ds-brand-700) !important; border-color: var(--ds-brand) !important;
}
.op-ds .op-dock-tab[aria-expanded="true"] :is(.op-dock-tab-icon, .op-dock-tab-count, .op-dock-tab-text) { color: var(--ds-brand-700); }
.op-ds .op-dock-tab-count { background: none; color: var(--ds-ink-2); font-weight: 600; min-width: 0; padding: 0; }
.op-ds .op-dock-thumb img, .op-ds .op-dock-thumb { border: 0; border-radius: var(--ds-r-sm); }
.op-ds .op-dock-panel { background: var(--ds-surface); border: 1px solid var(--ds-line); box-shadow: var(--ds-shadow); }
.op-ds .op-dock-title { display: flex; align-items: baseline; gap: 8px; font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-dock-sub { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-3); }
.op-ds .op-dock-btn {
    width: 32px; height: 32px; align-items: center; justify-content: center; padding: 0;
    border: 0; background: none; border-radius: var(--ds-r-md); color: var(--ds-icon); cursor: pointer;
}
.op-ds .op-dock-btn:hover { background: var(--ds-sunken); color: var(--ds-ink); }
.op-ds .op-dock-pin[aria-pressed="true"] { background: var(--ds-brand-50); color: var(--ds-brand-700); }
.op-ds .op-dock-tabs { gap: 4px 16px; }
.op-ds .op-cp-cell.is-missing { border: 0; background: var(--ds-n-50); color: var(--ds-ink-3); }
/* A file cell is a flat grey well. A view not taken keeps a light dashed
   square (R-DOC-21: "a light dashed square with the view name"), the same
   empty-slot mark as the upload zones, so screen and report agree. */
.op-ds .op-cp-cell.is-file .op-cp-shot { border: 0; background: var(--ds-n-50); }
.op-ds .op-cp-cell.is-missing .op-cp-shot { border: 1px dashed var(--ds-n-300); background: var(--ds-n-50); }
.op-ds :is(.op-cp-missing, .op-cp-file) { font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-3); }
/* "All / All + X-rays", "Normal bite / Second bite": chips, not a grey track. */
.op-ds .op-seg { display: inline-flex; flex-wrap: wrap; gap: 6px; padding: 0; background: none; border-radius: 0; }
.op-ds .op-seg-btn {
    min-height: var(--ds-h-sm); padding: 0 12px; box-sizing: border-box; cursor: pointer;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-n-700);
    background: var(--ds-surface); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-md); box-shadow: none;
}
.op-ds .op-seg-btn:hover { background: var(--ds-n-50); border-color: var(--ds-field-line); }
.op-ds .op-seg-btn:is(.is-active, [aria-pressed="true"]) {
    background: var(--ds-brand-50); color: var(--ds-brand-700); border-color: var(--ds-brand); box-shadow: inset 0 0 0 1px var(--ds-brand); font-weight: 600;
}
/* Download image and Print: secondary small buttons. */
.op-ds .op-cp-actions .op-btn.op-btn-ghost { background: var(--ds-surface) !important; border-color: var(--ds-line-strong) !important; color: var(--ds-ink) !important; }
.op-ds .op-cp-actions .op-btn.op-btn-ghost:hover { background: var(--ds-n-50) !important; border-color: var(--ds-field-line) !important; }

/* ---- 22. Screens (spec 9) ------------------------------------------------------- */
/* 9.1 Clinic & Patient: a private case says so at marker size (R-CLI-08). */
.op-ds .op-share-card.is-private { border-color: var(--ds-line); background: var(--ds-surface); }
.op-ds .op-share-card.is-private > .op-fsec-head:first-child { border: 0; background: none; }
.op-ds .op-share-card .op-share-state, .op-ds .op-share-card .op-share-private { color: var(--ds-danger-text); }
.op-ds .op-share-card .op-btn-danger { color: var(--ds-ink) !important; border-color: var(--ds-line-strong) !important; background: var(--ds-surface) !important; }
.op-ds .op-share-card .op-btn-danger:hover { background: var(--ds-n-50) !important; }
.op-ds :is(.op-path-fold, .op-path-state) { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; }
.op-ds .op-path-fold > summary { font: 500 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds :is(.op-collect-inline, .op-due-now) { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
.op-ds .op-due-now { margin-top: var(--ds-sp-4); padding-top: var(--ds-sp-4); border-top: 1px solid var(--ds-line); }
.op-ds .op-due-label { font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); text-transform: none; letter-spacing: normal; }
.op-ds .op-split-box { background: none; border: 0; padding: 0; }
/* 9.2 Photos: neutral tiles; the photo tools are one row of icon buttons. */
.op-ds .op-photo-slot,
.op-ds .op-photo-slot:is(.is-missing, .has-file, .is-new) { border: 1px solid var(--ds-line); background: var(--ds-surface); border-radius: var(--ds-r-lg); box-shadow: none; }
/* The drop zone: a quiet well on an empty view; dashed ONLY on a missing
   required view (spec 9.2); on a filled view a single "Replace" link line —
   the element stays and still takes a drop. */
.op-ds .op-photo-slot :is(.op-photo-upload, .op-upload-zone) {
    border: 0; border-radius: var(--ds-r-md); background: var(--ds-n-50); color: var(--ds-ink-2); min-height: 56px; padding: 10px;
}
.op-ds .op-photo-slot.is-missing :is(.op-photo-upload, .op-upload-zone) { border: 1px dashed var(--ds-n-300); }
.op-ds .op-photo-slot.has-file :is(.op-photo-upload, .op-upload-zone) {
    border: 0; background: none; padding: 4px 0; min-height: 0; align-items: flex-start; text-align: start; color: var(--ds-brand);
}
.op-ds .op-photo-slot.has-file :is(.op-photo-upload, .op-upload-zone):is(:hover, .is-dragover) { background: var(--ds-brand-50); }
.op-ds .op-photo-slot.has-file .op-photo-upload-hint { display: none; }
.op-ds .op-photo-upload-cta { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); }
.op-ds .op-photo-slot.has-file .op-photo-upload-cta { justify-content: flex-start; width: auto; }
.op-ds .op-photo-upload-hint { font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-3); }
/* "Required" is a badge (a warning dot while the view is missing), not a red *. */
.op-ds .op-photo-slot-label .op-req { display: none; }
.op-ds .op-photo-slot-label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); }
.op-ds .op-req-badge { height: 20px; }
.op-ds .op-photo-slot.is-missing .op-req-badge { --dot: var(--ds-warning); }
.op-ds .op-photo-slot.is-missing .op-req-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--dot); }
.op-ds .op-photo-slot:not(.is-missing) .op-req-badge { display: none; }
/* Remove: a white 28 px disc in the photo's corner, not a dark one. */
.op-ds .op-photo-thumb .op-delete-att {
    /* 32: the tap floor (assert-mobile), a white disc on the photo's corner. */
    width: 32px; height: 32px; padding: 0; font-size: 0; opacity: 1;
    background: var(--ds-surface) !important; color: var(--ds-ink-2) !important; border: 1px solid var(--ds-line) !important;
    box-shadow: var(--ds-shadow);
}
.op-ds .op-photo-thumb .op-delete-att:hover { background: var(--ds-danger-bg) !important; color: var(--ds-danger-text) !important; }
.op-ds .op-photo-thumb .op-delete-att .op-ic { width: 14px; height: 14px; }
.op-ds .op-photo-thumb { border: 0; border-radius: var(--ds-r-md); background: var(--ds-n-50); }
.op-ds .op-photo-tools { gap: 2px; }
.op-ds .op-photo-tool {
    flex: none; width: 32px; min-width: 32px; min-height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 0; background: none; border-radius: var(--ds-r-md); color: var(--ds-icon); cursor: pointer;
}
/* Three 32 px icon buttons; the names stay as each one's title and aria-label. */
.op-ds .op-photo-tool-name { display: none; }
.op-ds .op-photo-tool:hover { background: var(--ds-sunken); color: var(--ds-ink); }
.op-ds .op-ic-ccw { transform: scaleX(-1); }
.op-ds .op-tool-notes { position: static; }
/* fix/ceph24 (M24-47): "All N, in order" — a clear button, not a grey line. */
.op-ds .op-gallery-all > summary.op-gallery-allbtn { font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); background: var(--ds-surface); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-md); min-height: 44px; }
.op-ds .op-gallery-all[open] > summary.op-gallery-allbtn { background: var(--ds-n-50); }
.op-ds .op-missing-banner { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-md); color: var(--ds-ink); margin-bottom: var(--ds-sp-3); }
/* fix/ceph24 (M24-41): "Still to upload" is a red warning — its icon and its words — each item a link to its slot. */
.op-ds .op-missing-banner.is-required { background: var(--ds-danger-bg); border-color: var(--ds-danger-line); color: var(--ds-danger-text); }
.op-ds .op-missing-banner.is-required .op-missing-line { white-space: normal; overflow: visible; }
.op-ds .op-missing-banner.is-required :is(.op-missing-list, .op-missing-gate, strong) { color: var(--ds-danger-text); }
.op-ds .op-missing-banner.is-required strong { font-weight: 600; }
.op-ds .op-missing-item { color: var(--ds-danger-text); text-decoration: underline; text-underline-offset: 2px; display: inline-block; min-height: 24px; padding-block: 2px; }
.op-ds .op-missing-item:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 1px; }
.op-ds .op-missing-sep { color: var(--ds-danger-text); }
@media (pointer: coarse), (max-width: 1024px) { .op-ds .op-missing-item { min-height: 44px; display: inline-flex; align-items: center; } }
/* fix/ceph24 review (M24-41): a phone names three, "Show all N" opens the rest (a checkbox before the line, CSS only). */
.op-ds .op-missing-toggle { position: absolute; width: 0; height: 0; margin: 0; padding: 0; border: 0; opacity: 0; pointer-events: none; -webkit-appearance: none; appearance: none; }
.op-ds .op-missing-banner .op-missing-more { display: none; }
@media (max-width: 640px) {
    .op-ds .op-missing-banner .is-extra { display: none; }
    .op-ds .op-missing-banner .op-missing-more { display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--ds-sp-2); color: var(--ds-danger-text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
    .op-ds .op-missing-toggle:focus-visible + .op-missing-line .op-missing-more { outline: 2px solid var(--ds-focus); outline-offset: 1px; }
    .op-ds .op-missing-toggle:checked + .op-missing-line .op-missing-item.is-extra { display: inline-flex; }
    .op-ds .op-missing-toggle:checked + .op-missing-line .op-missing-sep.is-extra { display: inline; }
    .op-ds .op-missing-toggle:checked + .op-missing-line .op-missing-more { display: none; }
}
.op-ds .op-photo-slot { scroll-margin-top: 96px; }
.op-ds .op-photo-slot:target { outline: 2px solid var(--ds-danger); outline-offset: 2px; border-radius: var(--ds-r-md); }
/* "Still to upload": one line, three views and "and N more" (the rest in its tooltip). */
.op-ds .op-missing-banner.is-line { align-items: center; }
.op-ds .op-missing-line { margin: 0; min-width: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-ds .op-missing-line strong { font-weight: 500; }
.op-ds .op-missing-list { color: var(--ds-ink); }
.op-ds .op-missing-more { color: var(--ds-ink-2); }
.op-ds .op-missing-gate { color: var(--ds-ink-2); }
.op-ds .op-missing-gate::before { content: '· '; }
@media (max-width: 640px) { .op-ds .op-missing-line { white-space: normal; } }
/* Functional shift: an alert row with its button, not a card round a button. */
.op-ds .op-card.op-shift-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
    padding: 6px 12px; margin-bottom: var(--ds-sp-4);
    background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-md); box-shadow: none;
}
.op-ds .op-shift-bar > .op-btn { min-height: var(--ds-h-sm); padding: 0 10px; font-size: var(--ds-fs-sm); }
.op-ds .op-shift-bar :is(.op-shift-hint, .op-shift-state) { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); flex: 1 1 260px; }
/* 9.3 Diagnosis: the Buccal sides are two columns split by a hairline. */
.op-ds .op-dx-buccal > .op-bs-side + .op-bs-side { border-inline-start: 1px solid var(--ds-line); padding-inline-start: 24px; }
@media (min-width: 1024px) {
    /* Inclination (upper, lower) and Curve of Spee (upper, lower) share one
       row: each pair took half of a 4-column row and left the other half empty. */
    .op-ds .op-dx-block[data-dx-block="inclination"] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--ds-sp-5); align-items: start; }
    .op-ds .op-dx-block[data-dx-block="inclination"] > :not(.op-field-grid) { grid-column: 1 / -1; }
    .op-ds .op-dx-block[data-dx-block="inclination"] > .op-field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; margin: 0; }
    /* Two sides, each half the card (the 4-column field grid gave each a quarter,
       so Class I, II and III stacked and 60% of the card stood empty). */
    .op-ds .op-field-grid.op-dx-buccal { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
.op-ds .op-chips-grouped { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 12px 24px; }
.op-ds .op-chip-group { flex: 0 1 auto; min-width: 0; }
.op-ds .op-bs-head { font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
/* 9.4 Treatment: the 2nd phase is grouped like the 1st, in grey; no teal band and tint. */
.op-ds .op-plan-line.is-two-phase { background: var(--ds-n-50); border-inline-start-color: var(--ds-line-strong); }
.op-ds .op-phase-label-2 { color: var(--ds-ink); }
/* 9.4 Treatment: a section opened inside a card is set off by a hairline, not a dashed rule. */
.op-ds .op-fsec-line > .op-reveal,
.op-ds .op-statusbar-withdraw { border-top-style: solid; border-top-color: var(--ds-line); }
/* 9.5 The signature pad: a sunken well with a solid line (the canvas and its strokes untouched). */
.op-ds .op-sigpad { border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-md); background: var(--ds-n-50); }
/* 9.4 Treatment: the plan versions. fix/ver (11 Nov 2026, R11-PLN-01…04): one
   row — the label, the versions, and the buttons of the version in view pinned
   at its end. The versions wrap inside their own column, so a third or fourth
   one never pushes Modify onto a line by itself (seen on 11 Nov, 0:24:20), and
   the row stays as low as it was (the first field of the step within reach).
   The Active plan is the chosen one, so it is the teal one: a teal edge, the
   brand tint and a solid "Active" badge. Drafts are grey with a grey badge.
   The version on screen has an ink tab line on its lower edge — "where I am" —
   which never reads as "which one is Active". */
.op-ds .op-card.op-plan-versions {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 6px 12px;
    background: none; border: 0; box-shadow: none; padding: 0; margin-bottom: var(--ds-sp-4);
}
.op-ds .op-plan-versions-head { display: contents; }
.op-ds .op-plan-versions-head > .op-field-label { grid-column: 1; grid-row: 1; margin: 0 !important; min-height: 32px; display: flex; align-items: center; }
.op-ds .op-plan-version-list { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.op-ds .op-plan-version-actions { grid-column: 3; grid-row: 1; display: flex; flex-wrap: nowrap; gap: 8px; margin: 0; align-items: center; }
.op-ds .op-plan-versions > :is(.op-plan-versions-full, .op-field-hint) { grid-column: 1 / -1; }
.op-ds .op-plan-versions .op-plan-modify.op-btn-primary { background: var(--ds-surface) !important; color: var(--ds-ink) !important; border-color: var(--ds-line-strong) !important; }
.op-ds .op-plan-versions .op-plan-modify.op-btn-primary:hover { background: var(--ds-n-50) !important; border-color: var(--ds-field-line) !important; }
.op-ds .op-plan-versions .op-plan-modify:disabled { background: var(--ds-n-50) !important; color: var(--ds-ink-3) !important; }
.op-ds .op-plan-versions .op-plan-delete { color: var(--ds-danger); }
/* One line on a wide screen — "Treatment Plan 2 [Active] Modification 1 · 2 Nov 2026" — as low as the 3.1.0 bar; two lines on a phone. */
.op-ds .op-plan-version-link {
    display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 8px; min-height: 32px; padding: 3px 10px; box-sizing: border-box;
    border: 1px solid var(--ds-line) !important; border-radius: var(--ds-r-md); background: var(--ds-surface); box-shadow: none;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink) !important; text-decoration: none !important;
}
.op-ds .op-plan-version-link:hover { border-color: var(--ds-line-strong) !important; }
.op-ds .op-plan-version.is-frozen .op-plan-version-link { border-style: solid !important; }
.op-ds .op-plan-version.is-working .op-plan-version-link {
    border-color: var(--ds-brand) !important; box-shadow: inset 0 0 0 1px var(--ds-brand); background: var(--ds-brand-50);
}
.op-ds .op-plan-version.is-viewing .op-plan-version-link::after { inset-inline: 8px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--ds-ink); }
.op-ds .op-plan-version-top b { font-weight: 600; }
.op-ds .op-plan-version-sub { font-size: var(--ds-fs-xs); line-height: var(--ds-lh-xs); color: var(--ds-ink-3); }
.op-ds .op-plan-version-tag {
    height: auto; padding: 0 7px; border-radius: var(--ds-r-full); background: var(--ds-n-100); color: var(--ds-ink-2);
    font: 600 var(--ds-fs-xs)/16px var(--ds-font);
}
.op-ds .op-plan-version-tag.is-active { background: var(--ds-brand); color: var(--ds-n-0); }
.op-ds .op-plan-version-tag .op-ic { width: 12px; height: 12px; vertical-align: -2px; }
.op-ds .op-plan-versions-full { margin: 0; font-size: var(--ds-fs-sm); color: var(--ds-ink-3); }
/* The sentence about what Modify does is that button's tooltip and description
   (aria-describedby), not a line every visit to the step has to scroll past. */
.op-ds .op-plan-versions > .op-field-hint { display: none; }
@media (pointer: coarse) {
    .op-ds .op-plan-version-link { min-height: 44px; }
}
@media (max-width: 900px) {
    /* Tablet and phone: the label and the buttons on one line, the versions under them. */
    .op-ds .op-card.op-plan-versions { grid-template-columns: minmax(0, 1fr) auto; }
    .op-ds .op-plan-version-list { grid-column: 1 / -1; grid-row: 2; }
    .op-ds .op-plan-version-actions { grid-column: 2; }
}
@media (max-width: 640px) {
    /* Phone: the buttons take the whole line under the label; the versions two to a row. */
    .op-ds .op-card.op-plan-versions { grid-template-columns: minmax(0, 1fr); }
    .op-ds .op-plan-version-actions { grid-column: 1; grid-row: 2; flex-wrap: wrap; }
    .op-ds .op-plan-version-actions > .op-btn { flex: 1 1 auto; justify-content: center; }
    .op-ds .op-plan-version-list { grid-row: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .op-ds .op-plan-version-link { width: 100%; flex-direction: column; align-items: flex-start; }
}
/* 9.1 "How this case is handled": a plain line with a Change link. */
.op-ds .op-path-fold > summary { border: 0; background: none; padding: 0; min-height: 40px; border-radius: 0; }
.op-ds .op-path-fold-change { font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-brand); }
/* 9.6 Before bonding: the tooth numbers are ink; the chart is where red belongs. */
.op-ds .op-seq-extract { color: var(--ds-ink); font-weight: 500; }
/* 9.8 Pending from the plan on Follow-up: a plain list, a dot per row. */
.op-ds :is(.op-followup-pending-title, .op-visit-pending-title) { font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); margin: 0 0 6px; }
.op-ds .op-pending-line { display: flex; align-items: baseline; gap: 10px; font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-pending-line::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; transform: translateY(-2px); }
.op-ds :is(.op-pending-line.is-overdue, .op-pending-item.is-overdue .op-pending-text) { color: var(--ds-ink); font-weight: 400; }
/* The visit form: items already on today's list are one line above it. */
.op-ds .op-pending-item.is-onplan { display: none; }
.op-ds .op-pending-onplan-sum { margin: 0 0 8px; }
/* 9.7 Lab: the state button is primary; Undo, Export and Details are links. */
.op-ds .op-lab-actions { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 4px 8px; }
.op-ds .op-lab-actions .op-btn-ghost {
    min-height: 0; padding: 7px 2px; margin-block: -7px; background: none !important; border: 0 !important; color: var(--ds-brand) !important;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font);
}
.op-ds .op-lab-actions .op-btn-ghost:hover { text-decoration: underline !important; }
.op-ds .op-lab-status:is(.is-not_sent, .is-sent, .is-received, .is-delivered) { background: var(--ds-sunken); color: var(--ds-n-700); }
.op-ds .op-lab-status.is-not_sent { --dot: var(--ds-warning); }
.op-ds .op-lab-status:is(.is-received, .is-delivered) { --dot: var(--ds-success); }
/* fix/calm2 (9.7): "My labs" folds whenever he has a lab, so the note about a
   lab gone from his book is an alert row above it, a card's gap from it. */
.op-ds .op-lab-book-note { margin: 0 0 var(--ds-sp-4); }
/* 9.9 Money: an unknown lab cost is quiet text, not an amber warning. */
.op-ds .op-money-unknown { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-3); }
/* 9.6 Clinical Steps: the board keeps a well — it is an instrument. */
.op-ds .op-mech { background: var(--ds-n-50); border: 0; border-radius: var(--ds-r-lg); }
.op-ds .op-toothchart { background: var(--ds-surface); border-color: var(--ds-line); border-radius: var(--ds-r-lg); }
/* 9.7 Lab: one action row. */
.op-ds .op-lab-order-no { font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); }
/* 9.8 Follow-up: no amber box, no start bar. */
.op-ds :is(.op-followup-pending, .op-visit-pending) { background: none; border: 0; border-radius: 0; padding: 0; box-shadow: none; color: var(--ds-ink); }
.op-ds .op-pending-line::before { background: var(--ds-n-400); }
.op-ds .op-pending-line.is-overdue::before { background: var(--ds-danger); }
.op-ds .op-visit-card { border: 1px solid var(--ds-line); border-inline-start-width: 1px; border-radius: var(--ds-r-lg); box-shadow: none; background: var(--ds-surface); padding: var(--ds-sp-5); }
@media (max-width: 640px) { .op-ds .op-visit-card { padding: var(--ds-sp-4); } }
.op-ds .op-visit-card.is-current { border-inline-start: 1px solid var(--ds-line); }
.op-ds .op-due-now, .op-ds .op-due-now.is-overdue { background: none; border: 0; border-top: 1px solid var(--ds-line); border-radius: 0; padding: var(--ds-sp-3) 0 0; }
.op-ds .op-visit-fold > summary { border: 0; background: none; border-radius: 0; padding-inline: 0; box-shadow: none; }
/* 9.10 Summary: the mini charts get the room to show 18 … 28 whole. */
.op-ds .op-summary-figs { grid-template-columns: repeat(auto-fit, minmax(min(600px, 100%), 1fr)); }
.op-ds .op-summary-fig .tchart-row { justify-content: safe center; }
.op-ds .op-summary-figs { gap: var(--ds-sp-5); }
.op-ds .op-summary-fig { border: 0; border-radius: 0; padding: 0; background: none; }
.op-ds .op-visit-rec-item:is(.is-bad, .is-good, .is-warn) { color: var(--ds-ink); font-weight: 400; }
.op-ds .op-visit-rec-item:is(.is-bad, .is-good, .is-warn):not(.has-colour)::before {
    content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-inline-end: 6px; vertical-align: 2px; background: var(--tone);
}
.op-ds .op-visit-rec-item.is-bad { --tone: var(--ds-danger); }
.op-ds .op-visit-rec-item.is-warn { --tone: var(--ds-warning); }
.op-ds .op-visit-rec-item.is-good { --tone: var(--ds-success); }
/* The same overdue instalment reads the same everywhere: a danger badge. */
.op-ds .op-due-now .op-pill-to_write_up { background: var(--ds-danger-bg); color: var(--ds-danger-text); --dot: var(--ds-danger); }
.op-ds .op-due-now .op-pill-to_write_up::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--dot); }
.op-ds .op-collect-inline strong { color: var(--ds-ink); font: 600 var(--ds-fs-lg)/var(--ds-lh-lg) var(--ds-font); }
.op-ds .op-collect-inline .op-collect-late { margin-top: 4px; }
.op-ds .op-visit-field-label { font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); text-transform: none; letter-spacing: normal; }
/* fix/vsum18 (W22-07, 22 Nov 2026), replacing fix/calm2's two-column grid (9.8):
   «عاجبني قوي الملخص … بس محتاجين نظبطها visually بشكل أحسن». Each part of the
   visit's record — on the open card and in its Summary panel alike — is its
   heading over a light rule, then one fact a line, at every width. A board
   line's items (one Power chain line's chains) each a line of their own after
   their dot; the " · " between them stays in the text, hidden. */
.op-ds .op-visit-record { gap: var(--ds-sp-2); }
.op-ds .op-visit-record > .op-visit-field { display: block; }
.op-ds .op-visit-record .op-visit-field-label {
    display: block; margin: 0 0 var(--ds-sp-1); padding: 0 0 var(--ds-sp-1); border-bottom: 1px solid var(--ds-line);
}
.op-ds .op-visit-record .op-visit-rec-items { display: block; font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-visit-record .op-visit-rec-item { display: block; padding: 1px 0; }
.op-ds .op-visit-record .op-visit-rec-item.has-mark { display: flex; }
.op-ds .op-visit-record .op-visit-rec-item.has-parts::before { content: none; display: none; }
.op-ds .op-visit-record .op-visit-rec-item.has-parts .op-visit-rec-part { display: block; padding-inline-start: var(--ds-sp-4); }
.op-ds .op-visit-record .op-visit-rec-part .op-mech-itemdot { margin-inline-end: 6px; }
.op-ds .op-visit-record .op-visit-rec-sep { display: none; }
/* "Not paid" is a danger badge (7.10) before the instalment, which stays ink: the
   badge carries the dot, so the line's own goes; a payment made late keeps it. */
.op-ds .op-visit-record .op-visit-rec-item.is-unpaid:not(.has-colour)::before { content: none; display: none; }
.op-ds .op-visit-rec-item.is-unpaid .op-badge { vertical-align: 1px; }
/* The Auxiliaries line: each tool an 8 px dot in its own shade (7.12), its name ink. */
.op-ds .op-visit-record .op-mech-itemdot,
.op-ds .op-visit-record .op-visit-rec-item.has-colour::before { width: 8px; height: 8px; }
.op-ds .op-visit-rec-auxiliaries .op-visit-rec-item { color: var(--ds-ink); }
.op-ds .op-visit-delete { background: none !important; color: var(--ds-icon) !important; border-radius: var(--ds-r-md); }
.op-ds .op-visit-delete:hover { background: var(--ds-sunken) !important; color: var(--ds-danger-text) !important; }
/* 9.10 Summary: the journey cards and the mini charts. */
.op-ds .op-journey-cell { background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-md); box-shadow: none; padding: 12px; }
.op-ds .op-journey-cell.is-current { background: var(--ds-brand-50); border-color: var(--ds-brand); }
.op-ds .op-journey-cell.is-completed { background: var(--ds-surface); border-color: var(--ds-line); }
.op-ds .op-journey-dot { border: 2px solid var(--ds-line-strong); background: var(--ds-surface); color: var(--ds-ink-3); font: 600 var(--ds-fs-xs)/1 var(--ds-font); box-shadow: none; }
.op-ds .op-journey-node.is-completed .op-journey-dot { background: var(--ds-brand); border-color: var(--ds-brand); color: var(--ds-n-0); }
.op-ds .op-journey-node.is-current .op-journey-dot { background: var(--ds-surface); border-color: var(--ds-brand); color: var(--ds-brand-700); box-shadow: none; }
.op-ds .op-journey-node::before { height: 1px; background: var(--ds-line-strong); }
.op-ds .op-journey-node:is(.is-completed, .is-current)::before { background: var(--ds-brand); }
.op-ds .op-journey-grid { grid-template-columns: minmax(0, 1fr); gap: var(--ds-sp-3); }
@media (min-width: 641px) { .op-ds .op-journey-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1280px) { .op-ds .op-journey-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
/* In a narrow cell a visit's date goes under its name whole, not broken at a hyphen. */
.op-ds .op-journey-visits li { flex-wrap: wrap; gap: 0 8px; }
.op-ds .op-journey-visits li > :is(strong, span) { white-space: nowrap; }
.op-ds .op-journey-num { font: 600 var(--ds-fs-xl)/var(--ds-lh-xl) var(--ds-font); color: var(--ds-ink); }
/* 9.12 My cases: one card design; the consultation card is the same card. */
.op-ds .op-case-card {
    background: var(--ds-surface) !important; border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg);
    box-shadow: none; padding: 16px; transform: none; color: var(--ds-ink) !important;
}
.op-ds .op-case-card:hover { transform: none; box-shadow: none; border-color: var(--ds-line-strong); }
.op-ds .op-case-card.is-consultation { background: var(--ds-surface) !important; background-image: none !important; color: var(--ds-ink) !important; }
.op-ds .op-case-card.is-consultation :is(.op-pill, .op-badge) { background: var(--ds-sunken) !important; border: 0 !important; color: var(--ds-n-700) !important; }
.op-ds .op-case-card.is-consultation :is(.op-case-name, .op-case-code, .op-case-meta) { color: inherit; opacity: 1; }
.op-ds .op-case-card.is-consultation :is(.op-case-code, .op-case-meta) { color: var(--ds-ink-2); }
.op-ds .op-case-card.is-consultation .op-pill-consult { --dot: var(--ds-info); }
/*
 * fix/misc (R11-DSH-01): "the consultation must stand out too — a border, or
 * something lighter" (11 Nov, 0:01:25). The card itself, not only its badge:
 * the brand's lightest tint and a brand bar on the reading side, lighter than
 * 3.0.0's dark green card. The name stays ink on the tint (16:1).
 */
.op-ds .op-case-card.is-consultation {
    background: var(--ds-brand-50) !important; border-color: var(--ds-brand-100);
    border-inline-start: 4px solid var(--ds-brand); padding-inline-start: 13px;
}
.op-ds .op-case-card.is-consultation:hover { border-color: var(--ds-brand); }
.op-ds .op-case-card.is-consultation :is(.op-pill, .op-badge) { background: var(--ds-surface) !important; }
/* ---- end fix/misc ---- */
.op-ds .op-case-card :is(.op-progress, .op-case-progress) { height: 4px; background: var(--ds-sunken); border-radius: 2px; }
.op-ds .op-case-card :is(.op-progress-bar, .op-case-progress-bar) { background: var(--ds-brand); border-radius: 2px; }
.op-ds .op-case-card .op-case-code { font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-case-card .op-case-name { font: 600 var(--ds-fs-lg)/var(--ds-lh-lg) var(--ds-font); color: var(--ds-ink); }
/* List pages: the page title sits 16 px under the bar. */
.op-ds > .op-page-head:not(.op-casebar), .op-ds > .op-topbar + * { margin-top: var(--ds-sp-4); }
.op-ds .op-page-head h1 { font: 600 var(--ds-fs-2xl)/var(--ds-lh-2xl) var(--ds-font); }
.op-ds .op-plan-badge { background: none; padding: 0; height: auto; color: var(--ds-ink-2); font-size: var(--ds-fs-sm); }
/* "Free · 2 / 3 active cases · 0 files · 0 MB": one quiet line, no pills. */
.op-ds .op-plan-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0; font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-plan-meta .op-usage-chip { background: none; padding: 0; margin: 0; border-radius: 0; font: inherit; color: var(--ds-ink-2) !important; }
.op-ds .op-plan-meta > * + *::before { content: '·'; padding-inline: 6px; color: var(--ds-ink-3); }
.op-ds a.op-usage-chip:hover { color: var(--ds-ink) !important; text-decoration: underline; }
/* "How it works" is a ghost button, not a teal-tinted pill (the tint means "chosen"). */
.op-ds .op-help-inline {
    min-height: var(--ds-h-md); padding: 0 10px; gap: 8px; border-radius: var(--ds-r-md);
    background: transparent !important; color: var(--ds-n-700) !important; border: 0 !important;
    font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font);
}
.op-ds .op-help-inline:hover { background: var(--ds-sunken) !important; color: var(--ds-ink) !important; }
/* My clinics: "All cases" is a normal card. */
.op-ds .op-clinic-card-all { border-style: solid; }
/* Follow-up timeline: no teal frame on "latest"; a 1 px line on both. */
.op-ds .op-gallery-pair .op-gallery-item img,
.op-ds .op-gallery-pair .op-gallery-item.is-latest img { border: 1px solid var(--ds-line); }
/* Empty one-liners are quiet, not italic. */
.op-ds :is(em, i).op-muted, .op-ds .op-muted > em, .op-ds .op-empty-line, .op-ds .op-mech-line-empty { font-style: normal; }
/* 9.15 Admin: the sidebar is white, one line at its edge. */
.op-ds .op-sidebar { background: var(--ds-surface); border-inline-end: 1px solid var(--ds-line); box-shadow: none; }
.op-ds .op-sidenav-link {
    display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px; border-radius: var(--ds-r-md);
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-n-700) !important;
}
.op-ds .op-sidenav-link:hover { background: var(--ds-sunken); color: var(--ds-ink) !important; }
.op-ds .op-sidenav-link.active { background: var(--ds-brand-50); color: var(--ds-brand-700) !important; font-weight: 600; }
.op-ds .op-side-icon { color: var(--ds-icon); }
.op-ds .op-brand-tag { background: var(--ds-sunken); color: var(--ds-n-700); border: 0; }
/* Team › Products: "Asked for: …" is a line with a warning dot and a Give it
   link, not an amber box three levels deep in a table cell. */
.op-ds .op-wanted-note {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px;
    margin-top: 8px; padding: 0; background: none; border: 0; border-radius: 0; box-shadow: none;
    font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2);
}
.op-ds .op-wanted-note::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--ds-warning); align-self: center; }
.op-ds .op-wanted-label { font-weight: 400; text-transform: none; letter-spacing: normal; }
.op-ds .op-wanted-label::after { content: ':'; }
.op-ds .op-wanted-note strong { font-weight: 500; color: var(--ds-ink); }
.op-ds .op-wanted-note .op-grant-wanted {
    min-height: 0; padding: 7px 2px; margin-block: -7px; background: none !important; border: 0 !important;
    color: var(--ds-brand) !important; font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font);
}
.op-ds .op-wanted-note .op-grant-wanted:hover { text-decoration: underline !important; }
/* The case's Suitability: its select reads "— not yet reviewed —" whole (one 120 px column cut it). */
.op-ds .op-form-grid > label:has(> #op-suitability) { grid-column: span 2; }
/* 9.16 Lab, front desk, sign-in. A stage is a plain row; its state is the badge after its name. */
.op-ds .op-stage-row { background: none; border-inline-start: 0; box-shadow: none; }
.op-ds .op-stage,
.op-ds .op-stage:is(.op-stage-completed, .op-stage-in_progress, .op-stage-pending, .op-stage-skipped) {
    background: none; border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0; margin: 0; padding: 8px 0; box-shadow: none;
}
.op-ds .op-stage-info { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--ds-ink-2); }
.op-ds .op-stage-info strong { color: var(--ds-ink); font-weight: 500; }
.op-ds .op-stage :is(.op-stage-status) { color: var(--ds-n-700); }
.op-ds .op-stage-completed .op-stage-status { --dot: var(--ds-success); color: var(--ds-n-700); }
.op-ds .op-stage-in_progress .op-stage-status { --dot: var(--ds-brand); color: var(--ds-n-700); }
/* One primary per card: the stage in progress keeps its Done; the stages waiting offer theirs quietly. */
.op-ds .op-stage:not(.op-stage-in_progress) .op-btn-primary[data-status] {
    background: var(--ds-surface) !important; color: var(--ds-ink) !important; border-color: var(--ds-line-strong) !important;
}
.op-ds .op-stage:not(.op-stage-in_progress) .op-btn-primary[data-status]:hover { background: var(--ds-n-50) !important; }
/* fix/calm2 (9.16): while a case is still being made, its carrier and tracking
   fields fold under "Shipping details", a row with the fold chevron (7.3). */
.op-ds .op-lab-shipping:has(> .op-lab-ship-fold) { padding-top: var(--ds-sp-2); }
.op-ds .op-lab-ship-fold[open] > summary { margin-bottom: var(--ds-sp-3); }
/* Admin › Cases by status: a plain row — dot, label, count — not a tile. */
.op-ds .op-status-grid { column-gap: var(--ds-sp-6); row-gap: 0; }
.op-ds .op-status-card,
.op-ds .op-status-card[class*="op-color-"] {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 8px 0; border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0;
    box-shadow: none; background: none !important; transform: none;
}
.op-ds .op-status-card:hover { border-color: var(--ds-line); box-shadow: none; transform: none; background: none !important; }
.op-ds a.op-status-card:hover .op-status-name { text-decoration: underline; }
.op-ds .op-status-name { display: inline-flex; align-items: center; gap: 8px; font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-status-name::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--dot, var(--ds-n-400)); }
.op-ds .op-status-count { font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-status-card.op-color-teal { --dot: var(--ds-brand); }
.op-ds .op-status-card:is(.op-color-blue, .op-color-purple, .op-color-coral, .op-color-orange) { --dot: var(--ds-info); }
.op-ds .op-status-card.op-color-amber { --dot: var(--ds-warning); }
.op-ds .op-status-card.op-color-green { --dot: var(--ds-success); }
.op-ds .op-status-card.op-color-red { --dot: var(--ds-danger); }
.op-ds .op-agenda-list { background: none; border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); gap: 0; overflow: hidden; }
/* Inside a card a list is rows on hairlines, not a second box. */
.op-ds .op-card .op-agenda-list { border: 0; border-top: 1px solid var(--ds-line); border-radius: 0; }
.op-ds .op-card .op-agenda-list .op-agenda-item { padding-inline: 0; }
.op-ds .op-card .op-agenda-list .op-agenda-item:last-child { border-bottom: 1px solid var(--ds-line); }
/* The doctor's front-desk accounts: rows on hairlines, not boxes in the card. */
.op-ds .op-desk-list { gap: 0; }
.op-ds .op-desk-row { border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0; background: none; padding: 10px 0; }
.op-ds .op-desk-row:last-child { border-bottom: 0; }
/* Front desk: a phone is ink and tabular; a name is text, not a grey code chip. */
.op-ds .op-appt-row .op-agenda-act a { color: var(--ds-ink) !important; font-variant-numeric: tabular-nums; }
.op-ds .op-agenda-who strong { font-weight: 500; color: var(--ds-ink); }
.op-ds .op-agenda-who code { background: none; padding: 0; border: 0; font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-agenda-daylabel { font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-agenda-day.is-today .op-agenda-daylabel { color: var(--ds-ink); }
.op-ds .op-agenda-daylabel.op-is-overdue { display: flex; align-items: center; gap: 6px; color: var(--ds-ink); }
.op-ds .op-agenda-daylabel.op-is-overdue::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--ds-danger); }
/* A count beside a heading is a count (spec 7.10), not a teal pill. */
.op-ds .op-count-chip {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
    border-radius: 9px; background: var(--ds-sunken); color: var(--ds-n-700); font: 500 var(--ds-fs-xs)/18px var(--ds-font);
}
.op-ds .op-agenda-item,
.op-ds .op-agenda-item:is(.is-overdue, .is-confirmed) {
    background: var(--ds-surface); border: 0; border-bottom: 1px solid var(--ds-line); border-inline-start: 0; box-shadow: none; border-radius: 0;
}
.op-ds .op-agenda-item:last-child { border-bottom: 0; }
.op-ds .op-agenda-when { font-weight: 500; color: var(--ds-ink-2); }
/* Appointments' side column: an even 16 px between its cards. */
.op-ds .op-agenda-side { display: flex; flex-direction: column; gap: var(--ds-sp-4); }
.op-ds .op-agenda-side > *, .op-ds .op-agenda-side > * > .op-card:only-child { margin-block: 0; }
/* Admin › Case: underline tabs; only the current one is teal (spec 7.14). */
.op-ds.op-admin .op-tabs-nav {
    display: flex; flex-wrap: nowrap; gap: 4px 20px; padding: 0; overflow-x: auto; scrollbar-width: thin;
    background: none; border: 0; border-bottom: 1px solid var(--ds-line); border-radius: 0; box-shadow: none;
}
.op-ds.op-admin .op-tabs-nav .op-tab-link {
    display: inline-flex; align-items: center; gap: 6px; flex: none; min-height: 40px; padding: 0 2px; margin-bottom: -1px;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font) !important; color: var(--ds-ink-2) !important;
    background: none !important; border: 0 !important; border-bottom: 2px solid transparent !important; border-radius: 0 !important;
    box-shadow: none !important; text-decoration: none !important;
}
.op-ds.op-admin .op-tabs-nav .op-tab-link:hover { color: var(--ds-ink) !important; }
.op-ds.op-admin .op-tabs-nav .op-tab-link.active {
    color: var(--ds-brand-700) !important; font-weight: 600 !important; border-bottom-color: var(--ds-brand) !important;
}
/* Consultation case: the service bar and "Where this case has got to" are ONE
   card (as adjacent derived cards are), the tracker a line of 10 px dots. */
.op-ds .op-card.op-service-bar + .op-card.op-statusbar-card {
    margin-top: calc(-1 * var(--ds-sp-4) - 1px); border-top-left-radius: 0; border-top-right-radius: 0;
}
.op-ds .op-card.op-service-bar:has(+ .op-card.op-statusbar-card) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.op-ds .op-card:is(.op-service-bar, .op-statusbar-card) { padding: 16px 20px; }
.op-ds .op-service-bar { gap: 6px; }
.op-ds .op-service-row { align-items: center; }
.op-ds .op-service-label { font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); text-transform: none; letter-spacing: normal; }
.op-ds .op-service-bar.is-blocked { border-inline-start: 1px solid var(--ds-line); }
.op-ds .op-statusbar-head { margin-bottom: var(--ds-sp-2); }
.op-ds .op-statusbar-title { font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
@media (min-width: 701px) {
    .op-ds .op-statusbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 0; }
    .op-ds .op-statusbar-step { flex-direction: row; align-items: center; gap: 8px; text-align: start; }
    .op-ds .op-statusbar-step::before { position: static; order: -1; width: 24px; height: 1px; margin-inline: 4px 2px; inset: auto; }
}
.op-ds .op-statusbar-step::before { background: var(--ds-line-strong); }
.op-ds .op-statusbar-step:is(.is-done, .is-current)::before { background: var(--ds-brand); }
.op-ds .op-statusbar-dot { width: 10px; height: 10px; border: 0; font-size: 0; background: var(--ds-n-300); box-shadow: none; flex: none; }
.op-ds .op-statusbar-step.is-done .op-statusbar-dot { background: var(--ds-brand); }
.op-ds .op-statusbar-step.is-current .op-statusbar-dot { background: var(--ds-surface); box-shadow: inset 0 0 0 2px var(--ds-brand); }
.op-ds .op-statusbar-label { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-statusbar-step:is(.is-done, .is-current) .op-statusbar-label { color: var(--ds-ink); font-weight: 500; }
.op-ds .op-statusbar-withdraw { margin-top: var(--ds-sp-3); padding-top: var(--ds-sp-3); }
/* Follow-up › Next appointment: the suggestions are chips; the two booking
   fields share a height and a baseline; their labels are field labels. */
.op-ds .op-slot-row { gap: 6px; }
.op-ds .op-slot-row > .op-field-label { flex-basis: 100%; margin-bottom: 0; }
.op-ds .op-slot {
    min-height: var(--ds-h-sm); padding: 0 12px; box-sizing: border-box; display: inline-flex; align-items: center;
    font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-n-700);
    background: var(--ds-surface); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-md);
}
.op-ds .op-slot:hover { background: var(--ds-n-50); border-color: var(--ds-field-line); }
.op-ds .op-slot.is-picked { background: var(--ds-brand-50); color: var(--ds-brand-700); border-color: var(--ds-brand); box-shadow: inset 0 0 0 1px var(--ds-brand); font-weight: 600; }
.op-ds .op-appt-form { align-items: flex-end; }
.op-ds .op-appt-form label { font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-appt-form :is(input[type="datetime-local"], input[type="text"]) {
    min-height: var(--ds-h-md); height: var(--ds-h-md); padding: 0 10px; box-sizing: border-box;
    font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink);
}
.op-ds :is(input[type="datetime-local"], input[type="month"], input[type="week"]) {
    min-height: var(--ds-h-md); padding: 0 10px; box-sizing: border-box; border: 1px solid var(--ds-field-line) !important; border-radius: var(--ds-r-md) !important;
    font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink) !important; background-color: var(--ds-surface) !important;
}
/* "Take the case back" once, in the status card, when that card is on the page. */
.op-ds:has(#op-consult-withdraw) .op-lock-note [data-consult-withdraw] { display: none; }
/* A fee requested is not a debt: ink, not red (spec 9.16). */
.op-ds .op-amount-due { color: var(--ds-ink); font-weight: 600; }
/* 9.8 "What the plan says for today": no teal block. */
.op-ds .op-visit-planned { background: none; padding: 0; border-radius: 0; }
.op-ds.op-auth .op-auth-card, .op-ds .op-auth-card { border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: none; }

/* ---- 23. Phone (≤ 640, spec 10.3) ---------------------------------------------- */
@media (max-width: 640px) {
    /* Cards are full-bleed, so the content gets 358 of 390 px. */
    .op-ds .op-tab-panel .op-card {
        margin-inline: calc(-1 * var(--ds-gutter)); border-radius: 0; border-inline: 0; padding: var(--ds-sp-4);
    }
    .op-ds .op-card.op-fsec-derived + .op-card.op-fsec-derived { border-radius: 0; }
    /* The bottom bar: Prev · Photos · Notes · Messages · More · Next. Each tool
       is a 44 px icon button; nothing floats over the content. */
    .op-ds .op-wizard-foot { flex-wrap: nowrap; gap: 4px; padding-inline: 8px; padding-block: 7px; }
    .op-ds .op-wizard-mid { order: 0; width: auto; flex: 0 1 auto; justify-content: center; }
    .op-ds .op-wizard-count { display: none; }
    .op-ds .op-wizard-prev { flex: none; min-width: 44px; padding: 0 8px; }
    .op-ds .op-wizard-prev .op-btn-text { display: none; }
    .op-ds .op-wizard-next { flex: 1 1 auto; min-width: 112px; height: auto; min-height: 44px; padding: 4px 10px; }
    /* The next step's name keeps the room; the button itself says "forward". */
    .op-ds .op-wizard-next .op-wizard-arrow { display: none; }
    /* A long name ("Summary & Export", a 360 px screen) takes two lines, never an ellipsis. */
    .op-ds .op-wizard-next .op-btn-text { max-width: none; overflow: visible; text-overflow: clip; white-space: normal; line-height: 16px; text-align: center; }
    .op-ds :is(.op-tool-btn, .op-wizard-tools .op-notes-fab) { width: 44px; min-width: 44px; height: 44px; padding: 0; justify-content: center; }
    .op-ds :is(.op-tool-btn, .op-wizard-tools .op-notes-fab) :is(.op-tool-text, .op-notes-fab-text) {
        position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
    }
    .op-ds .op-tool-badge { position: absolute; transform: translate(10px, -10px); }
    .op-ds .op-tool-btn { position: relative; }
    .op-ds .op-wizard-tools .op-tool-photos:not([hidden]) { display: inline-flex; }
    .op-ds .op-dock-tab { display: none !important; }
    .op-ds .op-wizard-more { display: block; position: relative; }
    .op-ds .op-wizard-tools .op-wizard-more-btn { display: inline-flex; }
    .op-ds .op-wizard-more-menu {
        display: none; position: absolute; z-index: 50; inset-block-end: calc(100% + 8px); inset-inline-end: 0;
        min-width: 220px; padding: 8px; flex-direction: column; align-items: stretch; gap: 2px;
        background: var(--ds-surface); border: 1px solid var(--ds-line); border-radius: var(--ds-r-lg); box-shadow: var(--ds-shadow);
    }
    .op-ds .op-wizard-more.is-open .op-wizard-more-menu { display: flex; }
    .op-ds .op-wizard-more-menu .op-tool-btn { width: auto; justify-content: flex-start; padding: 0 12px; min-height: 44px; }
    .op-ds .op-wizard-more-menu .op-tool-btn .op-tool-text { display: inline; position: static; width: auto; height: auto; clip: auto; overflow: visible; }
    /* The context row: the journey, then the notices and the Photos button
       (the rail's own head and strip are the dock's, one tap away). */
    .op-ds .op-photo-rail-toggle { display: none; }
    .op-ds .op-workarea > .op-photo-rail { flex: 0 0 auto; }
    .op-ds .op-workarea { row-gap: 4px; column-gap: var(--ds-sp-4); }
    /* A section head with a Modify stays one row; its source line goes under. */
    .op-ds .op-card > .op-fsec-head:first-child:has(> .op-modify) { flex-wrap: wrap; }
    .op-ds .op-card.op-fsec-derived > .op-fsec-head:first-child .op-fsec-title { flex: 1 1 0; }
    .op-ds .op-card.op-fsec-derived .op-fsec-sub { order: 5; flex-basis: 100%; }
    .op-ds .op-card:is(.op-derived, .op-fsec-derived) { padding: 12px 16px; }
    .op-ds .op-linked-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; }
    .op-ds .op-summary-card { padding: 12px 16px; }
    .op-ds .op-sequence > .op-tabs-nav { margin-bottom: var(--ds-sp-2); }
    .op-ds .op-rail-tabs-label, .op-ds .op-rail-tab:not(.op-rail-tab-phone) { display: none; }
    .op-ds .op-rail-tabs > .op-rail-tab-phone { display: inline-flex; }
}

@media (max-width: 640px) {
    /* Admin: the sidebar is ONE scrollable row of 44 px items (it wrapped to four rows). */
    .op-ds .op-sidebar { width: 100%; padding: 4px var(--ds-gutter); }
    .op-ds .op-sidenav { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 2px; overflow-x: auto; scrollbar-width: thin; padding: 0; }
    .op-ds .op-sidenav-link { flex: none; min-height: 44px; white-space: nowrap; }
    /* The clinic chip shows 12 characters of the name (it showed 4): the
       building icon goes, the chip's padding and gaps tighten. */
    .op-ds .op-clinic-chip { max-width: none; padding: 0 6px; gap: 4px; }
    .op-ds .op-clinic-chip > :first-child:not(.op-clinic-chip-name) { display: none; }
    .op-ds .op-clinic-chip-name { max-width: 12ch; }
    .op-ds .op-kpi-card { flex-direction: row; justify-content: space-between; align-items: baseline; }
    /* Phone: "label ………… figure" on one line (spec 7.13). */
    .op-ds .op-kpi-card > div:not(.op-kpi-icon) { flex: 1; min-width: 0; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
    .op-ds .op-kpi-value { font-size: var(--ds-fs-xl); line-height: var(--ds-lh-xl); }
}

/* ---- 24. Touch: chair-side sizes on a coarse pointer (spec 10.4) ---------------- */
@media (pointer: coarse) {
    .op-ds :is(.op-chip, .op-toggle-btn) { min-height: 44px; }
    .op-ds :is(.op-input, input[type="text"], input[type="number"], input[type="date"], input[type="tel"],
               input[type="email"], input[type="search"], input[type="password"], input[type="url"], input[type="time"], input:not([type]), select, textarea) {
        min-height: 48px; font-size: 16px;
    }
    .op-ds .op-btn { min-height: 44px; }
    .op-ds .op-btn-primary { min-height: 52px; }
    .op-ds .op-sequence .op-tab-link { min-height: 44px; }
    .op-ds .op-fold-btn { width: 44px; height: 44px; }
    .op-ds .op-step-index-link, .op-ds .op-step-index-fold { min-height: 44px; }
    .op-ds .op-check-tile { min-height: 48px; }
    .op-ds :is(.op-tool-btn, .op-wizard-tools .op-notes-fab, .op-case-notices-sum, .op-dock-btn) { min-height: 44px; }
    .op-ds .op-dock-btn { width: 44px; }
    .op-ds :is(.op-btn.op-btn-text, .op-btn-link, .op-modify, .op-addopt-open, .op-note-fold-toggle) { padding-block: 13px; margin-block: -13px; }
}

/* ---- 25. Opt-in two columns (never guessed; DECISION §10) ----------------------- */
@media (min-width: 1024px) {
    .op-ds .op-cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
    .op-ds .op-cols-2 > .op-fsec-head, .op-ds .op-cols-2 > .op-wide { grid-column: 1 / -1; }
}

/* ---- 26. Motion and print -------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .op-ds *, .op-ds *::before, .op-ds *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}
@media print {
    .op-ds .op-casebar, .op-ds .op-step-index, .op-ds .op-sequence > .op-tabs-nav { position: static; }
    .op-ds .op-float-save, .op-ds .op-fold-btn { display: none !important; }
    .op-ds .op-card.op-foldable.is-folded > :not(.op-fsec-head:first-child) { display: revert; }
}

/* ---- fix/dia: the three pillars, visible (11 Nov 2026, R11-DIA-01) ------------
   "Instead of just a dot beside it, a highlight behind it, so it is very clear"
   — and not the 3.0 colours back ("we don't want it garish"): the middle way.
   Each pillar card carries its colour twice: a 4 px rule along its inline-start
   edge and a muted tint behind its title. Three hues, three tints, nothing
   else; the title stays ink (above 14:1 on every tint). The same rule and tint
   mark the Diagnosis summary rows, the problem-list groups on Justification,
   the Summary's pillars and the PDF (OrthoPlan_Clinical::pillar_colours() holds
   these six values for the PDF; tools/diagnosis_check.php keeps them equal).
   The three tints are tokens of section 0, beside the pillar hues.
   fix/look25 (25 Nov): the 4 px rule is gone — the card's 2 px frame in its
   colour says it (fix/look16's block) — and the title takes the colour. */
.op-ds {
    --op-pillar-skeletal-bg: var(--ds-pillar-skeletal-tint);
    --op-pillar-dental-bg:   var(--ds-pillar-dental-tint);
    --op-pillar-soft-bg:     var(--ds-pillar-soft-tint);
}
.op-ds .op-card.op-pillar-card > .op-fsec-head.op-pillar-head:first-child {
    background: var(--op-pillar-tint); border-radius: var(--ds-r-md);
    /* The band reaches into the card's own padding: the title stays where it
       was and the first field starts where spec 15 puts it (the head's 16 px
       below, less the band's 10). */
    padding: 10px 12px; margin: -10px -12px 6px;
}
/* The dot goes: the rule and the highlight say it. */
.op-ds .op-card:is(.op-fsec-skeletal, .op-fsec-dental, .op-fsec-soft, .op-fsec-extra) > .op-fsec-head:first-child .op-fsec-title::before { content: none; }
.op-ds .op-summary-row.op-pillar-row { border-inline-start: 3px solid var(--op-pillar) !important; padding-inline-start: 10px !important; }
/* Soft tissue, three by three (R11-DIA-04): three columns wherever three fit. */
@media (min-width: 900px) {
    .op-ds .op-field-grid.op-dx-soft3 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
/* A finding's picker sits under its tick (R11-DIA-05), set in from the tick's box. */
.op-ds .op-dx-tile-teeth { padding-inline-start: 26px; }
@media (max-width: 640px) { .op-ds .op-dx-tile-teeth { padding-inline-start: 0; } }
/* "Typed before": a quiet small box and its ×, a control like the others. */
.op-ds .op-dx-typed > .op-field-label { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-dx-typed-clear { border-color: var(--ds-line); border-radius: var(--ds-r-md); background: var(--ds-surface); color: var(--ds-ink-2); }
.op-ds .op-dx-typed-clear:hover,
.op-ds .op-dx-typed-clear:focus-visible { color: var(--ds-danger-text); border-color: var(--ds-danger-line); background: var(--ds-danger-bg); }
/* Molar and Canine, the row headings of a buccal side: ink, a step above the captions. */
/* !important: the calm field label sets its font and colour with it (section 10). */
.op-ds .op-dx-bs-row > .op-field-chips > .op-field-label { font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font) !important; color: var(--ds-ink) !important; }
.op-ds .op-dx-bs-row + .op-dx-bs-row { border-top-color: var(--ds-line); }
/* Chair-side, every target on these screens is a thumb's 44 px: the picker's
   Whole quadrant (six pickers on Diagnosis now) and "+ Add your VIP feature". */
@media (pointer: coarse) {
    .op-ds .op-tpick-whole { min-height: 36px; }   /* fix/ceph24 (M24-13): the picker smaller still, as its teeth */
    .op-ds .op-dx-block .op-addopt-open { padding-block: 16px; margin-block: -16px; }
}
/* ---- end fix/dia ---- */
/* ---- fix/pln-line (11 Nov 2026): the plan's line and phases, and his own × ---- */
.op-ds .op-chip.is-own { border-start-end-radius: 0 !important; border-end-end-radius: 0 !important; }
.op-ds .op-own-x {
    min-height: var(--ds-h-sm); border: 1px solid var(--ds-line-strong); border-inline-start: 0;
    background: var(--ds-surface); color: var(--ds-ink-3);
    border-start-end-radius: var(--ds-r-md); border-end-end-radius: var(--ds-r-md);
}
.op-ds .op-chip.is-own:is(.is-active, [aria-pressed="true"], [aria-checked="true"]) + .op-own-x { border-color: var(--ds-brand); background: var(--ds-brand-50); color: var(--ds-brand-700); }
.op-ds .op-own-x:hover, .op-ds .op-own-x:focus-visible { color: var(--ds-danger) !important; }
.op-ds .op-own-tag { border-color: var(--ds-line-strong); border-radius: var(--ds-r-md); background: var(--ds-surface); }
.op-ds .op-own-tag .op-own-x { background: none; border: 0; }
.op-ds .op-addopt-own-cap { color: var(--ds-ink-3); }
.op-ds .op-phase-group + .op-phase-group { border-top-color: var(--ds-line); }
.op-ds .op-field-chips.is-invalid > .op-field-label { color: var(--ds-danger); }
.op-ds .op-field-chips.is-invalid .op-chip:not(.is-active):not([aria-pressed="true"]):not([aria-checked="true"]) { border-color: var(--ds-danger) !important; }
.op-ds .op-field-error { color: var(--ds-danger); font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); }
@media (pointer: coarse) {
    .op-ds .op-own-x { min-width: 44px; min-height: 44px; }
}
/* ---- fix/look 11 Nov (R11-SHL-01, R11-SHL-02, M11-04): three levels on every step ----
   Dr. Abdallah on the calm look: «حلو إنه هادي، بس مشكلته … plain زيادة عن
   اللزوم» and «لازم يبقى فيه highlight … أنا بتوه … مولر دي تايهة». Measured on
   3.1.0, a field label ("AP relation") was 13 px, weight 500, grey (ink-2):
   the size of the chips under it and only a shade off them, so the step read
   at one level and the eye had nowhere to land. The answer is emphasis, not
   colour: no new hue (the three pillar tints of fix/dia are the only ones
   past the 3.1.0 registry). Every step now reads in three levels:

     1. the section title, the largest and darkest (18 px, 600, ink); a group
        inside a section (Buccal segment, a visit's "1 · Compliance") sits
        half a step under it (16 px, 600, ink);
     2. the field label, bold and dark (14 px, 600, ink) with a short grey bar
        at its inline start: its highlight. A bar, not a fill: a tinted box
        behind forty labels is the busy screen he said he did not want;
     3. the chips and values, regular (13–14 px, 400). A chosen chip keeps its
        teal tint, border and weight: "chosen" is a state, not a level.

   The sizes are the calm scale's own (Arabic one pixel up, section 0): only
   the roles are new. One place to tune: the tokens below. New look off
   (Settings › General): not one rule here applies. */
.op-ds {
    --ds-l1-fs: var(--ds-fs-xl);  --ds-l1-lh: var(--ds-lh-xl);     /* 1. section title         */
    --ds-l1b-fs: var(--ds-fs-lg); --ds-l1b-lh: var(--ds-lh-lg);    /* 1b. a group in a section */
    --ds-l2-fs: var(--ds-fs-md);  --ds-l2-lh: var(--ds-lh-md);     /* 2. field label           */
    --ds-label-rule: var(--ds-n-300);                              /* 2. its highlight, grey   */
    --ds-label-rule-w: 3px;
    /* What a box with its own edge (a rule, a border) keeps at its inline
       start so the bar, hung 8 px before the words, stays 8 px clear of it. */
    --ds-label-room: calc(8px + var(--ds-label-rule-w) + 8px);
}
/* On a phone the title steps down to 17 px, under Clinical Steps' phase
   headline (18 there), and the group level steps down with it, one pixel
   over the label: 17 / 15 / 14 (Arabic 18 / 16 / 15). Three sizes still,
   the title two over its groups, never two levels at one size (review:
   «زيارة جديدة» read no larger than «مشاكل من الزيارات اللي فاتت» under it). */
@media (max-width: 600px) {
    .op-ds {
        --ds-l1-fs: calc(var(--ds-fs-lg) + 1px); --ds-l1-lh: var(--ds-lh-lg);
        --ds-l1b-fs: calc(var(--ds-fs-md) + 1px); --ds-l1b-lh: calc(var(--ds-lh-md) + 2px);
    }
}
/* 1. Section titles: every card's own title, the summaries, the Follow-up
   cards' plain h3, the visit form's "New visit", the problem-list groups. */
.op-ds .op-fsec-title,
.op-ds :is(.op-summary-title, .op-pgroup-title),
.op-ds .op-card > h3,
.op-ds .op-followup-head h3,
.op-ds #op-visit-form-title {
    font: 600 var(--ds-l1-fs)/var(--ds-l1-lh) var(--ds-font); color: var(--ds-ink); letter-spacing: normal; text-transform: none;
}
/* The pillar cards' own size rule (op-diagnosis.css, snapped to 18) follows the level too. */
.op-ds .op-card.op-pillar-card > .op-fsec-head .op-fsec-title { font-size: var(--ds-l1-fs); line-height: var(--ds-l1-lh); }
.op-ds .op-card > h3 { margin: 0 0 var(--ds-sp-3); }
.op-ds #op-visit-form-title { margin: 0 0 var(--ds-sp-4); }
/* The larger title carries the head; 12 px under it (was 16) keeps the first
   field where spec 15 puts it (Treatment ≤ 480 at 1440). */
.op-ds .op-card > .op-fsec-head:first-child:not(summary) { margin-bottom: var(--ds-sp-3); }
/* 1b. A group inside a section: Buccal segment, Arch analysis, a second head
   in one card, a card shown from another step, a visit-form section, a kind
   of expansion. Clinical Steps' "Clinical steps for Treatment Plan 1" heads
   the page as the plan's versions bar does, at this level: under the cards'
   titles (on a phone it tied with them). */
.op-ds .op-fsub:not(.op-dx-yesno > .op-fsub):not(#op-visit-form-title),
.op-ds .op-card > .op-fsec-head:not(:first-child) .op-fsec-title,
.op-ds .op-card.op-fsec-derived .op-fsec-title,
.op-ds .op-bs-head,
.op-ds :is(.op-followup-pending-title, .op-visit-pending-title),
.op-ds details.op-visit-sec > summary.op-visit-sec-title,
.op-ds .op-exp-kind > .op-exp-head > .op-exp-name,
.op-ds .op-steps-sets-title {
    font: 600 var(--ds-l1b-fs)/var(--ds-l1b-lh) var(--ds-font); color: var(--ds-ink);
}
.op-ds :is(.op-followup-pending-title, .op-visit-pending-title) { display: block; margin: var(--ds-sp-4) 0 var(--ds-sp-2); }
/* 2. Field labels: bold, dark, a 3 px grey bar before the words. The bar hangs
   in the margin, 8 px before the label (::before, absolute, at the inline
   start), so the words still line up with the chips and boxes under them, and
   a label that wraps its own input ("Book the next visit", "Name", "Signed
   by": a flex column) is marked the same way without moving the box. A long
   Arabic label is marked on its first line. */
.op-ds :is(.op-field-label, .op-readonly-label, .op-linked-label, .op-seq-label, .op-visit-field-label),
.op-ds .op-dx-yesno > .op-fsub,
.op-ds :is(.op-distal-title, h6.op-visit-sec-sub, .op-wear-name),
.op-ds details.op-visit-subsec > summary.op-visit-sec-sub,
.op-ds .op-summary-row dt,
.op-ds .op-appt-form > label,
.op-ds .op-form-grid > label:not(:has(input:is([type="checkbox"], [type="radio"]))) {
    font: 600 var(--ds-l2-fs)/var(--ds-l2-lh) var(--ds-font) !important; color: var(--ds-ink) !important;
    text-transform: none; letter-spacing: normal;
}
.op-ds :is(.op-field-label, .op-readonly-label, .op-linked-label, .op-seq-label):not(.screen-reader-text),
.op-ds .op-dx-yesno > .op-fsub,
.op-ds :is(.op-distal-title, h6.op-visit-sec-sub),
.op-ds .op-appt-form > label,
.op-ds .op-form-grid > label:not(:has(input:is([type="checkbox"], [type="radio"]))) { position: relative; }
.op-ds :is(.op-field-label, .op-readonly-label, .op-linked-label, .op-seq-label):not(.screen-reader-text)::before,
.op-ds .op-dx-yesno > .op-fsub::before,
.op-ds :is(.op-distal-title, h6.op-visit-sec-sub)::before,
.op-ds .op-appt-form > label::before,
.op-ds .op-form-grid > label:not(:has(input:is([type="checkbox"], [type="radio"])))::before {
    content: ''; position: absolute; inset-inline-start: calc(-8px - var(--ds-label-rule-w));
    top: calc((var(--ds-l2-lh) - 1em) / 2); width: var(--ds-label-rule-w); height: 1em;
    border-radius: 2px; background: var(--ds-label-rule);
}
.op-ds :is(.op-field-label, .op-readonly-label, .op-linked-label) { margin-bottom: 6px; }
.op-ds .op-dx-yesno > .op-fsub { display: block; margin: 0 0 6px; padding: 0; border: 0; }
/* In a definition grid (a summary's rows, a recorded visit) the label starts
   its own row: bold and dark, no bar; the row's line already marks it. So
   does an Objectives row (its pillar rule) and the plan versions' caption,
   which heads a row of tabs at the page's edge, not a field. */
.op-ds .op-summary-row dt::before, .op-ds .op-visit-field-label::before,
.op-ds .op-obj-row .op-field-label::before,
.op-ds .op-plan-versions-head > .op-field-label::before { content: none; }
/* A box with its own start rule (the 1st phase) gives the bar room: 24 px. */
.op-ds .op-phase-block { padding-inline-start: var(--ds-sp-5); }
/* So do the boxes fix/pln-space draws inside Treatment Plan (review: the bar
   sat 1 px from their edge, a doubled line): the expander's panel with its
   teal rule, each arch's distalisation box, the body of an expansion kind;
   and the consent page on a phone, where its padding drops to 12. */
.op-ds :is(.op-exp-run, .op-distal-set, .op-exp-kind > .op-exp-body) { padding-inline-start: var(--ds-label-room); }
@media (max-width: 640px) {
    .op-ds .op-consent-paper { padding-inline-start: var(--ds-label-room); }
}
/* "Upper arch" / "Lower arch" head their box and label its side chips (One
   side or both): a field label like How and Planned distalisation under it.
   In the visit form, "Bonding", "Archwire", "Wearing what the plan asks"
   label the ticks or rows under them the same way (they were 13 px, under
   the 14 px labels they hold). */
/* A visit-form fold inside a section ("A · Archwires", "+ Compliance notes")
   and a wear row's name ("Facemask") head what is under them at the label's
   size and weight (the list above), never under it; the fold's chevron and
   the row's own border mark them, so no bar. */
/* The Clinical Steps board is a tool on its own grey ground, its rows marked
   by it: "TAD notes" there is bold ink with no bar (on a phone the bar fell
   3 px outside the board). The Summary's chart captions read like the
   definition rows beside them: bold ink, no bar (the chart scrolls inside
   its figure, which clipped the bar). */
.op-ds .op-mech .op-field-label::before,
.op-ds .op-summary-fig > figcaption.op-field-label::before { content: none; }
/* Molar and Canine (fix/dia) are the field labels of a buccal side: this
   level, set apart from the Class captions under them (12 px, 500, grey). */
.op-ds .op-dx-bs-row > .op-field-chips > .op-field-label { font: 600 var(--ds-l2-fs)/var(--ds-l2-lh) var(--ds-font) !important; }
/* On a phone the two buccal sides stack: the second is set off by a hairline
   above it, not by the desktop's column rule, which drew a stray line down
   its side and pushed it 24 px in. */
@media (max-width: 640px) {
    .op-ds .op-dx-buccal > .op-bs-side + .op-bs-side {
        border-inline-start: 0; padding-inline-start: 0;
        border-top: 1px solid var(--ds-line); padding-top: var(--ds-sp-5);
    }
}
/* An old case's "Typed before" note is a hint, not a label. */
.op-ds .op-dx-typed > .op-field-label { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font) !important; color: var(--ds-ink-2) !important; }
.op-ds .op-dx-typed > .op-field-label::before { content: none; }
/* A field he has to answer still turns its label red (fix/pln-line). */
.op-ds .op-field-chips.is-invalid > .op-field-label { color: var(--ds-danger) !important; }
/* 3. Chips and values: regular. */
.op-ds :is(.op-chip, .op-toggle-btn):not(.is-active):not([aria-pressed="true"]):not([aria-checked="true"]) { font-weight: 400; }
/* A value from another step: regular, on a line of its own, its Modify under it. */
.op-ds .op-linked-value { display: block; font-weight: 400; }
/* M11-04 (2): the visit form's "Problems from earlier visits" borrow the
   problem list's class, and with it its counter: a lone "1." printed 24 px
   outside the card, over the step rail. The list has no numbers to give. */
.op-ds .op-visit-problems .op-problem-item::before { content: none; }
/* M11-04 (3): Lab at 1280 — the orders table ran 26 px past its card, so each
   row's own action ("Sent to lab", "Received") was cut at the card's edge. On
   a desktop the one-line summary under the order number repeats the Type and
   Lab columns beside it; it stays on a phone, where each row is a card. */
@media (min-width: 641px) {
    .op-ds .op-lab-table .op-lab-order-line { display: none; }
    .op-ds .op-lab-table :is(th, td) { padding-inline: 8px; }
}
/* Review: that fit the table only with the photo dock shut, from 1024 up.
   With the dock kept open at 1440 (a 723 px card) or a window of 901-1000
   px the actions were still past the card's edge. op-lab.js measures the
   table against its card and, where it does not fit, sets .is-stacked: each
   order two columns of label and value, its number and its buttons on lines
   of their own (the layout fix/mobile gives a tablet, so the two agree). */
@media (min-width: 641px) {
    .op-ds .op-lab-table-wrap:has(> .op-lab-table.is-stacked) { overflow: visible; }
    .op-ds .op-lab-table.is-stacked, .op-ds .op-lab-table.is-stacked tbody:not([hidden]) { display: block; width: 100%; min-width: 0; }
    .op-ds .op-lab-table.is-stacked thead { display: none; }
    .op-ds .op-lab-table.is-stacked tr:not([hidden]) {
        display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px;
        padding: 12px 0; border-bottom: 1px solid var(--ds-line);
    }
    .op-ds .op-lab-table.is-stacked td { display: block; padding: 0; border: 0; min-width: 0; }
    .op-ds .op-lab-table.is-stacked td[data-label]::before {
        content: attr(data-label); display: block; font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-3);
    }
    .op-ds .op-lab-table.is-stacked td:first-child, .op-ds .op-lab-table.is-stacked td:last-child { grid-column: 1 / -1; }
    .op-ds .op-lab-table.is-stacked .op-lab-actions { justify-content: flex-start; }
}
/* The Lab cell takes its direction from the lab's name (dir="auto"), so on
   the Arabic page an English name ("Kazem lab") sat at the far left of its
   column, away from its «المعمل» heading, in the table, the stacked rows and
   the phone's cards alike, and a long name or type wrapped to lines flush
   with the wrong side. The words keep their own direction; the cell and its
   lines follow the page, as every other cell does (a browser without :dir()
   keeps the old place). */
.op-ds .op-lab-table td:dir(rtl) > .op-lab-cell[dir="auto"]:dir(ltr),
.op-ds .op-lab-table td:dir(ltr) > .op-lab-cell[dir="auto"]:dir(rtl) { align-items: flex-end; }
.op-ds .op-lab-table td:dir(rtl) [dir="auto"]:not(input, textarea):dir(ltr) { text-align: right; }
.op-ds .op-lab-table td:dir(ltr) [dir="auto"]:not(input, textarea):dir(rtl) { text-align: left; }
/* M11-04 (3): Follow-up's main action is "+ Add visit", under the Next
   appointment card. On a phone that card's last line, "Open my appointment
   book", pushed Add visit under the bottom bar (787 px on an Arabic phone, the
   bar at 784). The link is the card's own way out, so it sits at the end of
   the card's title line, as "The Files step" does on Patient files; where the
   line is too short for both it drops under the title. */
.op-ds .op-card.op-appt-card { display: flex; flex-wrap: wrap; align-items: baseline; }
.op-ds .op-card.op-appt-card > * { flex: 1 1 100%; order: 2; min-width: 0; }
.op-ds .op-card.op-appt-card > h3 { flex: 1 1 auto; order: 0; }
.op-ds .op-card.op-appt-card > .op-goto-agenda { flex: 0 1 auto; order: 1; margin-inline-start: auto; }
/* M11-04 (3): Money's main action in its first card — the next instalment
   owed, its overdue chip, its own "Collect now" (step-money.php). */
.op-ds .op-money-next {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--ds-sp-2) var(--ds-sp-3);
    margin: var(--ds-sp-3) 0; font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink);
}
.op-ds .op-money-next .op-collect-instalment { margin-inline-start: auto; }
@media (max-width: 640px) {
    .op-ds .op-money-next .op-collect-instalment { margin-inline-start: 0; flex: 1 1 100%; justify-content: center; }
}
/* Special appliances keep their taller chips, at the chips' own size. */
.op-ds .op-fsec-special .op-chip { font-size: var(--ds-fs-sm); line-height: var(--ds-lh-sm); }
/* ---- end fix/look ---- */

/* ---- integrator, 13 Nov: fix/doctor's "where the words come from" tag in the calm look ----
   Words in grey; our proposal gets the warning's 6 px dot and its text colour, never a fill (R11-SHL-01). */
.op-ds .op-instr-src { display: inline-flex; align-items: center; gap: 6px; padding: 0; background: none; border-radius: 0; color: var(--ds-ink-3); font-size: var(--ds-fs-sm); }
.op-ds .op-instr-src[hidden] { display: none; }
.op-ds .op-instr-src.is-proposal { background: none; color: var(--ds-warning-text); }
.op-ds .op-instr-src.is-proposal::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--ds-warning); }
/* Treatment Plan › Two phase: "1st phase" and "2nd phase" head a group of fields, at the group level
   (3.1.0's 12 px capitals read under the labels they hold: the acceptance walk of 13 Nov, R11-SHL-02). */
.op-ds .op-phase-label { font: 600 var(--ds-l1b-fs)/var(--ds-l1b-lh) var(--ds-font); color: var(--ds-ink); letter-spacing: normal; text-transform: none; }
/* ---- end integrator ---- */

/* ---- fix/look16 (16 Nov 2026): the pillars apart, the visit's to-do block, the photo strip ----
   Dr. Abdallah's voice notes of 14-16 Nov, after 3.2.0 on his phone
   (docs/meetings/2026-11-16/requirements.md). Colour only where he asked
   for it; the tokens are in section 0 under "fix/look16". */

/* R16-02 — Skeletal, Soft tissue and Dental, each its own block.
   «الدينتل والسوفت تشو غيّرت اللون بتاعهم، ولكن نفسه كلهم سايحين على بعض»:
   R11-DIA-01's 4 px rule and the faint band behind the title ran together on
   a phone, so on 16 Nov each card took its pillar's wash, its colour round
   every side and its title on a band across the top, 24 px between two.
   fix/look25 (25 Nov, M24-15): he chose proposal 1 — «الألوان تبقى بس في
   الاسم» — so the card is WHITE again; what stays apart is the frame: 2 px
   in the pillar's colour round every side (no 4 px rule), the title in that
   colour on a very light band of its tint right across the card's top, and
   24 px between two pillars. The same white, frame, band and coloured title
   mark the Summary's pillar blocks and the problem-list groups on
   Justification (the PDF follows through OrthoPlan_Clinical::pillar_colours()). */
.op-ds .op-pillar-skeletal { --op-pillar-band: var(--ds-pillar-skeletal-tint); }
.op-ds .op-pillar-dental   { --op-pillar-band: var(--ds-pillar-dental-tint); }
.op-ds .op-pillar-soft     { --op-pillar-band: var(--ds-pillar-soft-tint); }
.op-ds :is(.op-card.op-pillar-card, .op-summary-pillar, .op-pgroup) {
    background: var(--ds-surface);
    border: var(--ds-frame-card) solid var(--op-pillar);
}
.op-ds .op-card.op-pillar-card {
    --op-pc-pad: var(--ds-sp-5);
    padding: var(--op-pc-pad); margin-bottom: var(--ds-sp-5);
}
/* The band: the card's whole top, edge to edge, the title on it in the pillar's colour. */
.op-ds .op-card.op-pillar-card > .op-fsec-head.op-pillar-head:first-child {
    background: var(--op-pillar-band);
    margin: calc(-1 * var(--op-pc-pad)) calc(-1 * var(--op-pc-pad)) var(--ds-sp-4);
    padding: 12px var(--op-pc-pad);
    border-radius: calc(var(--ds-r-lg) - 2px) calc(var(--ds-r-lg) - 2px) 0 0;
}
.op-ds :is(.op-card.op-pillar-card, .op-summary-pillar) > .op-fsec-head.op-pillar-head:first-child .op-fsec-title,
.op-ds .op-pgroup .op-pgroup-title { color: var(--op-pillar); }
/* Folded, the card is its band. */
.op-ds .op-card.op-pillar-card.op-foldable.is-folded { padding-block: 0; }
.op-ds .op-card.op-pillar-card.op-foldable.is-folded > .op-fsec-head.op-pillar-head:first-child {
    margin: 0 calc(-1 * var(--op-pc-pad)); border-radius: calc(var(--ds-r-lg) - 2px);
}
@media (max-width: 640px) {
    /* Full-bleed on a phone: the frame on the top and the bottom, a canvas gap between two pillars. */
    .op-ds .op-tab-panel .op-card.op-pillar-card {
        --op-pc-pad: var(--ds-sp-4);
        border-inline: 0; border-radius: 0;
    }
    .op-ds .op-card.op-pillar-card > .op-fsec-head.op-pillar-head:first-child,
    .op-ds .op-card.op-pillar-card.op-foldable.is-folded > .op-fsec-head.op-pillar-head:first-child { border-radius: 0; }
}
/* The Summary's pillar blocks: the band too. */
/* Its fields sit on the white (no box each), the label's bar clear of the block's edge. */
.op-ds .op-summary-pillar { padding: 0 var(--ds-sp-3) var(--ds-sp-3) var(--ds-label-room); border-radius: var(--ds-r-lg); }
.op-ds .op-summary-pillar > .op-fsec-head.op-pillar-head:first-child {
    background: var(--op-pillar-band); margin: 0 calc(-1 * var(--ds-sp-3)) var(--ds-sp-3) calc(-1 * var(--ds-label-room)); padding: 8px var(--ds-sp-3) 8px var(--ds-label-room);
    border-radius: calc(var(--ds-r-lg) - 2px) calc(var(--ds-r-lg) - 2px) 0 0;
}
.op-ds .op-summary-pillar .op-linked-card { background: none; }

/* R16-05 — what this visit has to answer, one block at the top of the form.
   «لازم يكون الجدول ده ماركت كده وواضح في البداية … تديها له بلون أحمر».
   A danger bar and border round a light red wash, a warning icon and "To do
   at this visit (n)"; inside, a white row per item with a red marker. An
   answered row turns green (its marker a check) and goes to the end; with
   nothing left the block turns green too. The row markup (visit-pending.php)
   is li.op-todo-row > span.op-todo-mark: any group added to the block is
   drawn this way by these rules. The Follow-up step's own summary of what is
   open (.op-followup-pending) takes the same red block. */
.op-ds :is(.op-todo, .op-followup-pending) {
    margin: 0 0 var(--ds-sp-5); padding: var(--ds-sp-3) var(--ds-sp-4) var(--ds-sp-4);
    background: var(--ds-danger-wash); color: var(--ds-ink);
    border: 1px solid var(--ds-danger-line); border-inline-start: 4px solid var(--ds-danger); border-radius: var(--ds-r-lg);
}
.op-ds .op-todo.is-clear { background: var(--ds-success-wash); border-color: var(--ds-success-line); border-inline-start-color: var(--ds-success); }
.op-ds .op-todo-title {
    display: flex; align-items: center; gap: 8px; margin: 0 0 var(--ds-sp-3);
    font: 600 var(--ds-l1b-fs)/var(--ds-l1b-lh) var(--ds-font); color: var(--ds-ink);
}
.op-ds .op-todo-title > .op-todo-icon { color: var(--ds-danger); }
.op-ds .op-todo-n { font-variant-numeric: tabular-nums; }
.op-ds .op-todo.is-clear .op-todo-title > .op-todo-icon { --op-ic: var(--op-ic-check); color: var(--ds-success); }
/* Its groups ("Pending from the plan", "Problems from earlier visits") are
   row headings under the block's title, not titles of their own. */
.op-ds .op-todo .op-visit-pending + .op-visit-pending { margin-top: var(--ds-sp-4); }
.op-ds .op-todo .op-visit-pending-title { font: 600 var(--ds-l2-fs)/var(--ds-l2-lh) var(--ds-font); margin: 0 0 2px; }
.op-ds .op-todo .op-visit-pending > .op-field-hint { margin: 0 0 var(--ds-sp-2); }
.op-ds .op-todo .op-pending-list { display: flex; flex-direction: column; gap: var(--ds-sp-2); }
.op-ds .op-todo .op-todo-row {
    position: relative; margin: 0; padding: 10px 12px; padding-inline-start: 36px;
    background: var(--ds-surface); border: 1px solid var(--ds-danger-line); border-radius: var(--ds-r-md);
}
.op-ds .op-todo .op-pending-item.is-onplan { display: grid; }
.op-ds .op-todo .op-todo-row .op-pending-text { color: var(--ds-ink); font-weight: 600; }
.op-ds .op-todo .op-todo-row.is-overdue:not(.is-done) .op-pending-text { color: var(--ds-danger-text); }
.op-ds .op-todo-mark {
    display: block; position: absolute; inset-inline-start: 12px; top: 16px;
    width: 10px; height: 10px; border-radius: 50%; background: var(--ds-danger);
}
.op-ds .op-todo .op-todo-row.is-done { order: 1; background: var(--ds-success-wash); border-color: var(--ds-success-line); }
.op-ds .op-todo-row.is-done > .op-todo-mark {
    inset-inline-start: 9px; top: 13px; width: 16px; height: 16px; border-radius: 0; background: var(--ds-success);
    -webkit-mask: var(--op-ic-check) center / contain no-repeat; mask: var(--op-ic-check) center / contain no-repeat;
}
/* The Follow-up step's summary: each open line with its red marker. */
.op-ds .op-followup-pending .op-pending-lines { gap: var(--ds-sp-1); }
.op-ds .op-followup-pending .op-pending-line::before { width: 8px; height: 8px; background: var(--ds-danger); }
.op-ds .op-followup-pending .op-followup-problems-title { margin-top: var(--ds-sp-3); }
@media (max-width: 640px) {
    .op-ds :is(.op-todo, .op-followup-pending) { padding-inline: var(--ds-sp-3); }
    .op-ds .op-todo .op-todo-row { padding-inline-end: 8px; }
}

/* R16-06 — the photo strip at the top, as in 3.0.0.
   «الأول خالص كان عاجبني أحسن … الصور كده فوق في الشريط». 3.1.0 hid the
   strip on a phone (only a Photos button was left) and beside the photo
   lane from 1280. It is back at every width, on every case step but Patient
   Photos (that step IS the photos): a quiet row of thumbnails under its
   head — "This case" (it folds, remembered: op-shell.js), Collected photos
   and Follow-up timeline. On a phone it is one row that scrolls sideways
   inside the screen; a tap on a photo opens it, Follow-up timeline opens
   the timeline viewer. */
.op-ds:not(.op-rail-folded) .op-photo-rail.is-open .op-photo-rail-strip { display: flex; }
.op-ds.op-app.op-has-dock .op-photo-rail-chev { display: inline-flex; }
.op-ds .op-photo-rail .op-photo-rail-toggle { display: inline-flex; }
.op-ds .op-photo-rail-strip {
    flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin;
    gap: var(--ds-sp-2); padding: var(--ds-sp-2) 0 var(--ds-sp-1);
}
.op-ds .op-rail-item { flex: 0 0 auto; width: 88px; border-radius: var(--ds-r-sm); }
.op-ds .op-rail-shot { width: 88px; height: 66px; overflow: hidden; }
.op-ds .op-rail-cap { display: block; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* merge review (16 Nov): a caption cut to one line lost its meaning at a
   phone's 72 px ("add on Ph…", «ضيفها من ا…»); two lines, as 3.2.0 let it
   wrap, with the strip's height kept for two so nothing jumps. */
.op-ds .op-photo-rail-strip .op-rail-cap {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
    white-space: normal; overflow-wrap: normal; min-height: calc(2 * var(--ds-lh-xs));
}
.op-ds .op-rail-item:focus-visible { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
/* Patient Photos: the step shows every photo; the head keeps its viewers. */
.op-ds[data-active-step="photos"] .op-photo-rail .op-photo-rail-chev,
.op-ds[data-active-step="photos"]:not(.op-rail-folded) .op-photo-rail.is-open .op-photo-rail-strip { display: none; }
@media (max-width: 640px) {
    /* A row of its own under the journey and the notices; the head is one
       line: the fold (its photos icon and chevron; "This case" is still its
       name for a screen reader) · Collected photos · Follow-up timeline. */
    .op-ds .op-workarea > .op-photo-rail { flex: 0 0 100%; }
    .op-ds .op-photo-rail-head { gap: 0 2px; }
    .op-ds .op-photo-rail-toggle { padding-inline: 4px; gap: 4px; }
    .op-ds .op-photo-rail-title { font-size: 0; gap: 0; }
    .op-ds .op-photo-rail-count { display: none; }
    .op-ds .op-rail-tabs > .op-rail-tab.op-rail-tab-timeline { display: inline-flex; margin-inline-start: 0; }
    .op-ds .op-rail-tabs > .op-rail-tab-phone { order: -1; }
    /* walk of 16 Nov: 88 px on a phone too (the strip scrolls sideways), so
       "Upper occlusal (upper jaw)" and «الوش من قدام (من غير ابتسامة)» read whole. */
    .op-ds .op-rail-item { width: 88px; }
    .op-ds .op-rail-shot { width: 88px; height: 66px; overflow: hidden; }
}
/* (Its 44 px touch targets: op-zz-mobile.css, "fix/look16".) */
/* ---- end fix/look16 ---- */

/* ---- fix/shell18 (17 Nov 2026 call): the case shell and the look ---------------
   Dr. Abdallah on his tablet, 17 Nov (docs/meetings/2026-11-17/call): the
   phases boxed and darker than the steps (C17-SHL-01), one line per phase
   with Report on its own (C17-SHL-02), "On this step" one framed box with
   the current section green (C17-SHL-03), a visible thin outline round every
   section card (C17-SHL-04), each Diagnosis sub-section its own block with
   its labels marked (C17-DIA-01) and each group of a plan card in its own
   outlined box (C17-PLN-04). Emphasis by weight, outline and the tints the
   calm look already has: no new hue. The "green" of the current section is
   the registry's success role, a tint behind its words. */

/* C17-SHL-01 / -02 — «لازم يكون highlighted ومربع … اتقل … ده نقطة ما فيهاش
   نقاش» and «Report … تكون هنا تحتهم». Below 1280 (and wherever the step rail
   is not drawn) the bar is one line per phase, Records, Planning, Treatment,
   Report, each phase name boxed at the start of its line in the darkest ink
   and bold, its steps after it. A phase's steps that do not fit its line
   wrap under its first step, never under the box and never onto another
   phase's line. The box column is one width, so the four names align. */
.op-ds {
    --ds-phase-w: 104px;          /* the boxed phase name's column */
    --ds-phase-h: var(--ds-h-md); /* the line's height: one step link's */
    --ds-phase-box-h: 32px;       /* the box, centred on the line's first row */
}
@media (pointer: coarse) { .op-ds { --ds-phase-h: 44px; } }
.op-ds .op-sequence > .op-tabs-nav,
[dir="rtl"] .op-ds .op-sequence > .op-tabs-nav {
    display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 6px;
}
.op-ds .op-step-group {
    position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px;
    min-height: var(--ds-phase-h); padding-inline-start: calc(var(--ds-phase-w) + 10px);
}
.op-ds .op-step-phase {
    position: absolute; inset-inline-start: 0; top: calc((var(--ds-phase-h) - var(--ds-phase-box-h)) / 2); box-sizing: border-box;
    display: inline-flex; align-items: center; width: var(--ds-phase-w); height: var(--ds-phase-box-h); padding: 0 10px;
    font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink); white-space: nowrap;
    background: var(--ds-sunken); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-md);
}
/* The step rail (≥ 1280, in the app): the same boxed name heads each phase's column. */
@media (min-width: 1280px) {
    .op-ds.op-app .op-step-group { position: static; padding: 0; min-height: 0; }
    .op-ds.op-app .op-step-phase {
        position: static; display: flex; width: auto; height: auto; min-height: 28px; margin: 0 0 4px;
        padding: 4px 10px; font-size: var(--ds-fs-sm); line-height: var(--ds-lh-sm); font-weight: 600;
    }
}
@media (min-width: 1280px) and (max-height: 820px) {
    /* A 1280 × 720 laptop: eleven steps and four phases in 450 px. */
    .op-ds.op-app .op-step-phase { min-height: 24px; padding-block: 2px; margin-bottom: 2px; }
}

/* C17-SHL-03 — «الجزء ده كله اعمله اصلا في مستطيل … بولد شوية نفس الكنسبت بتاع
   بلانينج … واتخلي الهيلايت يبقى اخضر». One framed box from its label to Fold
   all; the names 600 and darker; the current section bold on a green pill,
   rounded all round and with a green dot before it (a pillar section keeps
   its own dot), so it reads as neither a chosen chip (a teal tint, a teal
   border, 6 px corners) nor the step bar's current step (a teal tint, its
   number on a teal disc). It still follows the scroll (op-shell.js). */
.op-ds .op-step-index {
    padding: 2px 6px; padding-inline-start: 12px; gap: 6px 12px;
    background: var(--ds-surface); border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-lg);
}
.op-ds .op-step-index-label {
    padding-inline-end: 12px; border-inline-end: 1px solid var(--ds-line);
    font: 600 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink);
}
.op-ds .op-step-index-link {
    min-height: 32px; padding: 0 10px; margin-inline-end: 4px;
    border: 1px solid transparent; border-radius: var(--ds-r-full);
    font-weight: 600; color: var(--ds-n-700) !important;
}
.op-ds .op-step-index-link:hover { color: var(--ds-ink) !important; background: var(--ds-sunken) !important; }
.op-ds .op-step-index-link.is-current {
    color: var(--ds-success-text) !important; background: var(--ds-success-bg) !important; border-color: var(--ds-success-line);
}
.op-ds .op-step-index-link.is-current:not([data-pillar])::before {
    content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--ds-success);
}
/* A finger's target stays 44 px (fix/mobile's touch pass): the pill grows to it. */
@media (pointer: coarse) { .op-ds .op-step-index-link { min-height: 44px; } }

/* C17-SHL-04 — «انا عايزها يبقى خط رفيع كده [حوالين] كل سكشن». Every section
   card of a case step has a thin outline in the strong line (1 px), on its
   canvas; no fill, no new hue. A card inside a card keeps its own line. The
   pillar cards keep their colour round them (fix/look16), and every card that
   draws its own edge (the voice notes' teal, a step's coloured cards) keeps
   it: the rule weighs no more than the card's own (.op-ds .op-card). */
.op-ds :where(.op-tab-panel) .op-card:where(:not(.op-pillar-card)) { border-color: var(--ds-line-strong); }
.op-ds :where(.op-tab-panel .op-card) .op-card:where(:not(.op-pillar-card)) { border-color: var(--ds-line); }
/* The calm look's own grey cards (a step's summary, a card shown from another step, Clinic's private share) take the same line. */
.op-ds :where(.op-tab-panel) .op-card:is(.op-summary-card, .op-derived, .op-fsec-derived),
.op-ds :where(.op-tab-panel) .op-share-card.is-private { border-color: var(--ds-line-strong); }

/* C17-DIA-01 — «الكلمة الكبيرة نفسها، اللي هو بدل ما هي bold بس … ده كده
   السكشن الواحد» and «upper crowding والـ lower crowding … لازم تبقى marked».
   Inside a Diagnosis pillar card each sub-section is a box of its own: its
   title on a band across its top (the group level, larger than the labels),
   its fields inside. Skeletal and Soft tissue have no sub-headings: their
   fields are one box. fix/look25 (25 Nov, M24-15, proposal 1): every box is
   white with the thick frame (2 px, --ds-frame) and 16 px between two
   boxes — «كله متحاوط … منفصلة عن المحتوى اللي قبلها ولا بعدها»; the
   title's band is the neutral canvas grey, not the pillar's tint; a field
   label is the calm look's own (bold ink, its grey bar), no band and no
   pillar rule (colour only in the pillar's own title). */
.op-ds .op-pillar-card :is(.op-dx-block, .op-dx-fields) {
    --op-dx-pad: var(--ds-sp-3);
    --op-dx-start: var(--ds-label-room);   /* the labels' grey bar sits in this gutter, clear of the frame */
    margin: var(--ds-sp-4) 0 0; padding: 0 var(--op-dx-pad) var(--op-dx-pad); padding-inline-start: var(--op-dx-start);
    background: var(--ds-surface); border: var(--ds-frame-group) solid var(--ds-frame); border-radius: var(--ds-r-lg);
}
.op-ds .op-pillar-card .op-dx-fields { padding-top: var(--op-dx-pad); }
.op-ds .op-pillar-card .op-fsec-head + :is(.op-dx-block, .op-dx-fields) { margin-top: 0; }
/* (op-diagnosis.css takes the first block's top rule off, for the old hairline between blocks: the box keeps it.) */
.op-ds .op-pillar-card > .op-fsec-head + .op-dx-block { border-top: var(--ds-frame-group) solid var(--ds-frame); }
.op-ds .op-pillar-card .op-dx-fields + :is(.op-note-fold, .op-field) { margin-top: var(--ds-sp-4); }
/* "Final intraoral notes" is the card's own notes fold, not a sub-section: no box. */
.op-ds .op-pillar-card .op-dx-block[data-dx-block="notes"] { background: none; border: 0; padding: 0; }
/* The title band: the block's whole top, edge to edge, a hairline under it. */
.op-ds .op-pillar-card .op-dx-block > .op-fsub:first-child,
.op-ds .op-pillar-card .op-dx-block > .op-dx-yesno:first-child {
    margin: 0 calc(-1 * var(--op-dx-pad)) var(--ds-sp-3); padding: 6px var(--op-dx-pad);
    margin-inline-start: calc(-1 * var(--op-dx-start)); padding-inline-start: var(--op-dx-start);
    background: var(--ds-canvas); border-bottom: 1px solid var(--ds-line);
    border-radius: calc(var(--ds-r-lg) - 2px) calc(var(--ds-r-lg) - 2px) 0 0;
}
.op-ds .op-pillar-card .op-dx-block > .op-fsub:first-child,
.op-ds .op-pillar-card .op-dx-block > .op-dx-yesno:first-child > .op-fsub {
    display: block; font: 600 var(--ds-l1b-fs)/var(--ds-l1b-lh) var(--ds-font) !important; color: var(--ds-ink) !important;
}
/* Crossbite and Rotations: the question is the block's title, No / Yes on its band. */
.op-ds .op-pillar-card .op-dx-block > .op-dx-yesno:first-child {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding-block: 6px;
}
.op-ds .op-pillar-card .op-dx-block > .op-dx-yesno:first-child > .op-fsub { margin: 0; }
.op-ds .op-pillar-card .op-dx-block > .op-dx-yesno:first-child > .op-fsub::before { content: none; }
.op-ds .op-pillar-card .op-dx-block > .op-dx-yesno:first-child > .op-field { margin: 0; }
/* A block whose answer is No is its band. */
.op-ds .op-pillar-card .op-dx-block:has(> .op-dx-yesno:first-child + [hidden]) { padding-bottom: 0; }
.op-ds .op-pillar-card .op-dx-block > .op-dx-yesno:first-child:has(+ [hidden]) {
    margin-bottom: 0; border-bottom: 0; border-radius: calc(var(--ds-r-lg) - 2px);
}
/* The field labels of a block: the calm look's own label, as on every other
   step — bold ink, its grey bar at the start (R11-SHL-02) — no band of the
   pillar's tint and no pillar rule (fix/look25: colour only in the pillar's title). */
/* Incisor class, Overjet and Overbite: the three fields of one row on a
   tablet too (Overbite dropped onto a row of its own at 768 and read as a
   heading); one under another, each banded, on a phone. */
@media (min-width: 641px) {
    .op-ds .op-field-grid.op-dx-incisor { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}

/* C17-PLN-04 — «السكشن نفسه … عارف كأنك بتحدده كده … متحاوط» and «الانكورج
   هنا لازق على طول في الاكسبانشن … ما فيش فراغ». Each group of questions in
   a Treatment Plan card is in its own outlined box, no fill: the stage, the
   1st phase, the line of treatment, the braces questions, each open method
   of space provision, and Anchorage — a block apart, 32 px under the methods. */
.op-ds .op-plan-group,
.op-ds .op-fsec-line > .op-plan-group,   /* the braces questions: a reveal, whose top rule this replaces */
.op-ds .op-fsec-stages .op-phase-block {
    margin: var(--ds-sp-3) 0 0; padding: var(--ds-sp-4); padding-inline-start: var(--ds-label-room);
    background: none; border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-lg);
}
.op-ds .op-plan-group[hidden] { display: none; }
.op-ds .op-fsec-head + .op-plan-group { margin-top: 0; }
.op-ds .op-plan-group > :last-child,
.op-ds .op-plan-group > .op-field-chips:last-child { margin-bottom: 0; }
.op-ds .op-plan-group.op-plan-anchorage { margin-top: var(--ds-sp-6); }
.op-ds .op-plan-anchorage > .op-fsub:first-child { margin-top: 0; }
/* ---- end fix/shell18 ---- */
/* ---- fix/lab18 (17 Nov 2026): the Lab step in sections, coloured by status ----
   C17-LAB-01: "Need action" on top, "For retention, later" under it, "Sent
   and received" below; one card per order at every width (the layout is
   op-lab.css). C17-LAB-02: each card in its status's wash and line, the
   chip in its tint with ink words and the status's dot — light red not sent,
   yellow sent, green back — and Need action's band in the light red. The
   'lab' role (section 0) is held to these places by assert-shell part look;
   the words on every one are ink or ink-2, 5.2:1 or more. */
.op-ds .op-lab-sec { margin-top: var(--ds-sp-5); }
/* Under the filters (they keep 12 px below them): the tablet's first card above the fold. */
.op-ds .op-lab-sec-need { margin-top: 0; }
.op-ds .op-lab-sec-head { gap: var(--ds-sp-2); }
.op-ds .op-lab-sec-need > .op-lab-sec-head {
    padding: 6px var(--ds-sp-3); border: 1px solid var(--ds-lab-todo-line); border-radius: var(--ds-r-md); background: var(--ds-lab-todo-wash);
}
.op-ds .op-lab-sec-title { margin: 0; }
.op-ds .op-lab-later-title { font: 600 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-lab-sec-count {
    height: 22px; min-width: 24px; padding: 0 8px; border-radius: var(--ds-r-full);
    background: var(--ds-surface); color: var(--ds-ink); border: 1px solid var(--ds-line-strong);
    font: 600 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font);
}
.op-ds .op-lab-sec-sub { margin: var(--ds-sp-1) 0 var(--ds-sp-2); font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-lab-sec-head > .op-lab-sec-sub { margin: 0; }
.op-ds .op-lab-sec-empty { margin: var(--ds-sp-2) 0 0; font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-lab-later { margin-top: var(--ds-sp-4); padding: var(--ds-sp-3); border: 1px dashed var(--ds-line-strong); border-radius: var(--ds-r-lg); }
.op-ds .op-lab-later .op-lab-planned { border-color: var(--ds-line-strong); }

/* The cards: a surface for any status the step does not know, else the status's wash and line. */
.op-ds .op-lab-orders .op-lab-table tbody.op-lab-order { border: 1px solid var(--ds-line-strong); border-radius: var(--ds-r-lg); background: var(--ds-surface); }
.op-ds .op-lab-orders .op-lab-table tbody.op-lab-order:has(> .op-lab-order-row.is-not_sent) { background: var(--ds-lab-todo-wash); border-color: var(--ds-lab-todo-line); }
.op-ds .op-lab-orders .op-lab-table tbody.op-lab-order:has(> .op-lab-order-row.is-sent) { background: var(--ds-lab-sent-wash); border-color: var(--ds-lab-sent-line); }
.op-ds .op-lab-orders .op-lab-table tbody.op-lab-order:has(> .op-lab-order-row.is-received) { background: var(--ds-lab-back-wash); border-color: var(--ds-lab-back-line); }
/* Waiting for the debonding: not to send yet, so white, its light red only the dashed edge and the chip. */
.op-ds .op-lab-orders .op-lab-later .op-lab-table tbody.op-lab-order:has(> .op-lab-order-row.is-not_sent) { background: var(--ds-surface); border-style: dashed; }
.op-ds .op-lab-orders .op-lab-table .op-lab-order-row > td { font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-lab-orders .op-lab-table .op-lab-order-row > td[data-label]::before { font: 500 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-lab-orders .op-lab-table .op-lab-order-row > td:first-child .op-lab-order-no { font: 600 var(--ds-fs-lg)/var(--ds-lh-lg) var(--ds-font); }
.op-ds .op-lab-orders .op-lab-table .op-lab-order-row > td.op-lab-actions-cell { border-top-color: var(--ds-line); }
/* Every hint on a card is ink-2, never ink-3 (4.5:1 on the darkest tint is the floor). */
.op-ds .op-lab-orders .op-lab-table .op-lab-order-row :is(.op-muted, .op-lab-cell .op-muted) { color: var(--ds-ink-2); }
.op-ds .op-lab-orders .op-lab-table .op-lab-order-edit > td { background: var(--ds-surface); border-top: 1px solid var(--ds-line); }
.op-ds .op-lab-next-none { font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }

/* The chip: the status's tint behind ink words, its dot at marker size — here and on the Lab orders screen. */
.op-ds .op-lab-status.is-not_sent { background: var(--ds-lab-todo-tint); color: var(--ds-ink); --dot: var(--ds-danger); }
.op-ds .op-lab-status.is-sent { background: var(--ds-lab-sent-tint); color: var(--ds-ink); --dot: var(--ds-warning); }
.op-ds .op-lab-status:is(.is-received, .is-delivered) { background: var(--ds-lab-back-tint); color: var(--ds-ink); --dot: var(--ds-success); }

/* C17-LAB-03: Wanted by on the card — a control, so a field's line and the brand's link words. */
.op-ds .op-lab-orders .op-lab-wanted { border-color: var(--ds-field-line); border-radius: var(--ds-r-md); background: var(--ds-surface); }
.op-ds .op-lab-orders .op-lab-wanted:focus-within { outline: 2px solid var(--ds-focus); outline-offset: 2px; }
.op-ds .op-lab-wanted-text { font: 500 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); color: var(--ds-ink); }
.op-ds .op-lab-wanted-text.op-muted { font-weight: 400; color: var(--ds-ink-2); }
.op-ds .op-lab-wanted-act { font: 500 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-brand); }
.op-ds .op-lab-orders .op-lab-wanted-input:focus { background: var(--ds-surface); color: var(--ds-ink); border-radius: var(--ds-r-md); }
.op-ds .op-lab-later-flag { font: 400 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-2); }

/* fix/lab18 review: nothing to send — Need action's band the sunken grey of a count, not light red; the
   orders the plan no longer asks for at the foot of Sent and received; the "already ordered" note. */
.op-ds .op-lab-sec-need.is-clear > .op-lab-sec-head { background: var(--ds-sunken); border-color: var(--ds-line); }
.op-ds .op-lab-off { margin-top: var(--ds-sp-4); }
.op-ds .op-lab-plan-have { margin-top: var(--ds-sp-1); font: 400 var(--ds-fs-sm)/var(--ds-lh-sm) var(--ds-font); color: var(--ds-ink-2); }
.op-ds .op-lab-plan-have-text { color: var(--ds-ink); }
.op-ds .op-lab-plan-have-show { color: var(--ds-brand); }
/* ---- end fix/lab18 ---- */
/* ---- fix/files18 (W22-08): Money's tabs in two headed groups -------------------
   «تعريب محترم ومتقسم»: who is owed (doctor, clinic, labs) and the instalments
   (late, on time, coming, collected), each with its name before its tabs. The
   two groups sit side by side while they fit and wrap whole; on a phone each
   name takes its own line above its tabs. The tabs keep section 17's look. */
.op-ds .op-money-tabs { flex-wrap: wrap; overflow-x: visible; column-gap: 40px; row-gap: 0; }
.op-ds .op-money-tabgroup { display: flex; flex-wrap: wrap; align-items: center; gap: 0 20px; min-width: 0; }
.op-ds .op-money-tabgroup-name {
    flex: none; font: 600 var(--ds-fs-xs)/var(--ds-lh-xs) var(--ds-font); color: var(--ds-ink-3);
}
@media (max-width: 640px) {
    .op-ds .op-money-tabgroup { flex: 1 1 100%; column-gap: 16px; }
    .op-ds .op-money-tabgroup-name { flex: 1 1 100%; padding-top: 10px; }
}
/* ---- end fix/files18 ---- */
/* ---- fix/look25 (25 Nov 2026, M24-15): white sections, colour in the titles, every box framed ----
   After docs/design/diagnosis-sections-2026-11-25.pdf Dr. Abdallah chose
   proposal 1 (white sections): «الألوان تبقى بس في الاسم … ونحاوط المربعات كلها
   بالـ outline السميك ده … عشان ما نتلخبطش فيها وتبقى منفصلة عن المحتوى اللي
   قبلها ولا بعدها», and in writing «خلينا نطبقه في treatment plan برضو». On
   Diagnosis and Treatment Plan every section card is white with a 2 px frame
   (a pillar card's in its colour, fix/look16's block; every other card's the
   strong neutral --ds-frame), every group inside a card is white with a
   2 px frame (Diagnosis's blocks above in C17-DIA-01; the plan's groups
   here, C17-PLN-04's boxes made thick), 16 px between two groups and 24 px
   between two cards. Colour is in the titles only: a pillar's title in its
   pillar's colour, every other section's in the brand's deep teal-ink
   (--ds-title, 10:1 on white). No card and no group is filled. */
.op-ds {
    --ds-title: var(--ds-brand-700);
}
.op-ds :is([data-panel="diagnosis"], [data-panel="treatment"], [data-section="diagnosis"], [data-section="treatment"]) .op-card:not(.op-pillar-card, .op-voice-card, .op-plan-versions, .op-card .op-card) {
    background: var(--ds-surface); border: var(--ds-frame-card) solid var(--ds-frame); margin-bottom: var(--ds-sp-5);
}
.op-ds :is([data-panel="diagnosis"], [data-panel="treatment"], [data-section="diagnosis"], [data-section="treatment"]) .op-card:not(.op-pillar-card, .op-card .op-card) > .op-fsec-head:first-child .op-fsec-title,
.op-ds :is([data-panel="diagnosis"], [data-panel="treatment"], [data-section="diagnosis"], [data-section="treatment"]) .op-card.op-summary-card .op-summary-head > .op-summary-title {
    color: var(--ds-title);
}
/* The plan's groups (C17-PLN-04): the same 2 px frame as a Diagnosis block, 16 px apart, no fill. */
.op-ds .op-plan-group,
.op-ds .op-fsec-line > .op-plan-group,
.op-ds .op-fsec-stages .op-phase-block {
    margin-top: var(--ds-sp-4); background: var(--ds-surface); border: var(--ds-frame-group) solid var(--ds-frame);
}
.op-ds .op-fsec-head + .op-plan-group { margin-top: 0; }
.op-ds .op-plan-group.op-plan-anchorage { margin-top: var(--ds-sp-6); }
/* ---- end fix/look25 ---- */
