/* ==========================================================================
   OrthoPlan Pro — the cephalometric tracing (17 Nov 2026, fix/ceph,
   R17-01). The "Cephalometric analysis" card on Diagnosis
   (public/views/case/ceph-analysis.php), "Analyse" under the film on
   Patient Photos, and the tracing editor (op-ceph.js).

   Calm: one card, the film with its tracing and the readings table beside
   it; teal only for the main action and what is chosen; the tracing's
   colours are the registry's --op-tracing-* and appear only on the film and
   as a dot in the list. Every control of the editor is 44 px or more. The
   film takes no touch gesture of the browser's (`touch-action: none`): a
   finger places, two fingers zoom and move the film. Right to left the
   tools read from the right; the film is never mirrored.
   ========================================================================== */

/* ---- The card ---- */
.op-frontend .op-ceph-card .op-ceph-body { margin-top: var(--op-sp-3); }
.op-frontend .op-ceph-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--op-sp-4);
    align-items: start;
}
/*
 * fix/ceph18: side by side when the CARD is wide enough for the Eastman table's six columns beside the film (a
 * computer: the card is the Photos step's width), one above the other below that — a 1024 tablet in landscape gets
 * the film, then the whole table, rather than a table squeezed to three lines a reading.
 */
.op-frontend .op-ceph-card .op-ceph-body { container-type: inline-size; }
@container (min-width: 1000px) {
    .op-frontend .op-ceph-layout { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
    /* The film stays in sight while he reads down the table. */
    .op-frontend .op-ceph-figure { position: sticky; top: 88px; }
}
.op-frontend .op-ceph-figure { margin: 0; min-width: 0; direction: ltr; }   /* the film is never mirrored */
.op-frontend .op-ceph-figbtn {
    display: block; width: 100%;
    margin: 0; padding: 0;
    border: 1px solid var(--op-border); border-radius: var(--op-radius-sm);
    background: var(--op-bg-alt);
    overflow: hidden; cursor: pointer;
}
.op-frontend .op-ceph-figbtn:hover { border-color: var(--op-border-strong); }
.op-frontend .op-ceph-figbtn:focus-visible { outline: 2px solid var(--op-primary); outline-offset: 2px; }
.op-frontend .op-ceph-svg { display: block; width: 100%; height: auto; }
.op-frontend .op-ceph-figcap {
    margin-top: var(--op-sp-2);
    font-size: 13px; line-height: 18px; color: var(--op-text-muted);
    text-align: center;
}
[dir="rtl"] .op-frontend .op-ceph-figcap, .op-frontend[dir="rtl"] .op-ceph-figcap { direction: rtl; }
.op-frontend .op-ceph-side { min-width: 0; }
.op-frontend .op-ceph-actions { display: flex; flex-wrap: wrap; gap: var(--op-sp-2); }
.op-frontend .op-ceph-actions .op-btn { min-height: 44px; display: inline-flex; align-items: center; gap: var(--op-sp-1); }
.op-frontend .op-ceph-actions .op-btn[hidden] { display: none; }
.op-frontend .op-ceph-dl, .op-frontend .op-ceph-open { white-space: nowrap; }
.op-frontend .op-ceph-filmpick {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-2);
    margin: 0 0 var(--op-sp-3);
}
/*
 * fix/cephpolish (P6): the two norm sets an even pair at every width, one
 * above the other in one column as wide as the longer label (each on one
 * line), or the whole width when that is narrower (a phone: the longer label
 * then wraps inside its button, never the shorter alone). At 390 the
 * Egyptian label wrapped and the pair was 333 and 358 px wide; side by side
 * in three auto-fit tracks (the review) both labels wrapped on a computer.
 */
.op-frontend .op-ceph-norms {
    display: grid; grid-template-columns: minmax(0, max-content); justify-content: start;
    gap: var(--op-sp-2);
    margin-top: var(--op-sp-3);
}
.op-frontend .op-ceph-normslabel { font-size: 13px; font-weight: 500; color: var(--op-text-muted); }
.op-frontend .op-ceph-norms .op-ceph-seg { width: 100%; }
/* fix/cephpolish (P12): a long title wraps beside the fold arrow, never pushing it onto a line of its own. */
.op-frontend .op-ceph-card > .op-fsec-head > .op-fsec-title { flex: 1 1 0%; }
.op-frontend .op-ceph-seg {
    min-height: 44px;
    padding: 6px var(--op-sp-3);
    border: 1px solid var(--op-border); border-radius: var(--op-radius-sm);
    background: var(--op-surface); color: var(--op-text);
    font: inherit; font-size: 14px; line-height: 18px; text-align: start;
    cursor: pointer;
}
.op-frontend .op-ceph-seg:hover:not(:disabled) { border-color: var(--op-border-strong); }
.op-frontend .op-ceph-seg:focus-visible { outline: 2px solid var(--op-primary); outline-offset: 2px; }
.op-frontend .op-ceph-seg:disabled { cursor: default; opacity: .7; }
.op-frontend .op-ceph-seg:is([aria-checked="true"], [aria-pressed="true"]) {
    border-color: var(--op-primary);
    background: var(--op-primary-light);
    color: var(--op-primary);
    box-shadow: inset 0 0 0 1px var(--op-primary);
}
.op-frontend .op-ceph-source { margin: var(--op-sp-2) 0 0; font-size: 12px; line-height: 17px; color: var(--op-text-muted); }
.op-frontend .op-ceph-tablewrap { margin-top: var(--op-sp-3); }
.op-frontend .op-ceph-remark { margin: var(--op-sp-3) 0 0; font-size: 13px; line-height: 18px; color: var(--op-text-muted); }

/*
 * The readings table: four columns that fit a 360 px phone. fix/cephpolish
 * (P5): the columns take the width their values need — a value stays with
 * its unit ("70.0 mm"), a norm with its ± and its marks ("127.21 ± 6°†"),
 * each on one line — and the reading's name wraps in what is left.
 */
.op-frontend .op-ceph-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 14px; line-height: 19px;
    font-variant-numeric: tabular-nums;
}
.op-frontend .op-ceph-table th,
.op-frontend .op-ceph-table td {
    padding: 6px var(--op-sp-1);
    border-bottom: 1px solid var(--op-border);
    text-align: start; vertical-align: top;
    overflow-wrap: normal;      /* fix/cephpolish (P5): a word is never cut ("طبيـ / عي"); a line breaks at its spaces */
}
.op-frontend .op-ceph-table thead th { font-size: 12px; font-weight: 500; color: var(--op-text-muted); }
.op-frontend .op-ceph-table :is(.op-ceph-val, .op-ceph-norm) { white-space: nowrap; overflow-wrap: normal; }
/*
 * Narrower than four whole columns (a 360 px phone, the editor's side panel;
 * in Arabic «طول الوش السفلي (ANS-Me / N-Me)» is one 124 px piece, R16-07):
 * each reading on two lines — its name, then its value, norm and status in
 * three even columns — rather than a value or a norm split, or the table
 * running out of the card.
 */
.op-frontend :is([data-ceph-tablewrap], [data-ceph-live]) { container-type: inline-size; }
@container (max-width: 345px) {
    .op-frontend .op-ceph-table, .op-frontend .op-ceph-table > :is(thead, tbody) { display: block; }
    .op-frontend .op-ceph-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: var(--op-sp-2); border-bottom: 1px solid var(--op-border); }
    .op-frontend .op-ceph-table :is(th, td) { display: block; border-bottom: 0; padding: 2px 0; }
    .op-frontend .op-ceph-table tr > :first-child { grid-column: 1 / -1; padding-top: 6px; }
    .op-frontend .op-ceph-table tr > :last-child { padding-bottom: 6px; }
    .op-frontend .op-ceph-table tr.op-ceph-grouprow { display: block; border-bottom-color: var(--op-border-strong); }
}
.op-frontend .op-ceph-grouprow th { padding-top: var(--op-sp-3); font-size: 13px; font-weight: 600; color: var(--op-text); border-bottom-color: var(--op-border-strong); }
.op-frontend .op-ceph-rname { font-weight: 500; }
.op-frontend .op-ceph-unit { font-weight: 400; color: var(--op-text-muted); }
/* fix/ceph review: "N-Me", "E-line" never broken at their hyphen (a right-to-left line wrapped "N-" / "Me"). */
.op-frontend .op-ceph-nw { white-space: nowrap; }
.op-frontend .op-ceph-val bdi, .op-frontend .op-ceph-norm bdi { unicode-bidi: isolate; direction: ltr; white-space: nowrap; }
.op-frontend .op-ceph-norm { color: var(--op-text-muted); }
.op-frontend .op-ceph-mark { margin-inline-start: 2px; color: var(--op-text-muted); }
.op-frontend .op-ceph-badge { display: inline-block; white-space: nowrap; padding: 0 6px; border-radius: var(--op-radius-sm); font-size: 13px; line-height: 20px; color: var(--op-text-muted); }
.op-frontend .op-ceph-badge.is-increased,
.op-frontend .op-ceph-badge.is-decreased { background: var(--op-warning-bg); color: var(--op-warning-text); font-weight: 500; }
.op-frontend .op-ceph-why { font-size: 12px; line-height: 16px; color: var(--op-text-soft); }
.op-frontend .op-ceph-marks { list-style: none; margin: var(--op-sp-2) 0 0; padding: 0; font-size: 12px; line-height: 17px; color: var(--op-text-muted); }

.op-frontend .op-ceph-empty { display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-3); margin-top: var(--op-sp-3); }
.op-frontend .op-ceph-empty p { margin: 0; color: var(--op-text-muted); }
.op-frontend .op-ceph-empty .op-btn { min-height: 44px; display: inline-flex; align-items: center; gap: var(--op-sp-1); }

/* "Analyse" under the film on Patient Photos. */
.op-frontend .op-ceph-analyse { min-height: 44px; display: inline-flex; align-items: center; gap: var(--op-sp-1); margin-top: var(--op-sp-2); }
.op-frontend .op-ceph-ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.op-frontend .op-ceph-host[hidden] { display: none; }

/* ---- The editor ---- */
html.op-ceph-open, html.op-ceph-open body { overflow: hidden; }
.op-frontend .op-ceph-modal[hidden] { display: none; }
.op-frontend .op-ceph-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.op-frontend .op-ceph-backdrop { position: absolute; inset: 0; z-index: 0; }
.op-frontend .op-ceph-box {
    position: relative; z-index: 1;
    display: flex; flex-direction: column;
    gap: var(--op-sp-2);
    width: min(1320px, calc(100vw - 32px));
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
    padding: var(--op-sp-3) var(--op-sp-4) var(--op-sp-4);
    border-radius: var(--op-radius-lg);
    background: var(--op-surface);
    box-shadow: var(--op-shadow-lg);
    color: var(--op-text);
}
.op-frontend .op-ceph-head { display: flex; align-items: center; gap: var(--op-sp-3); }
.op-frontend .op-ceph-title { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
.op-frontend .op-ceph-box .op-ceph-note {
    margin: 0; padding: var(--op-sp-2) var(--op-sp-3);
    border-radius: var(--op-radius-sm);
    background: var(--op-warning-bg); color: var(--op-warning-text);
    font-size: 13px; line-height: 18px;
}
.op-frontend .op-ceph-box .op-ceph-note.is-info { background: var(--op-info-bg); color: var(--op-info-text); }
.op-frontend .op-ceph-box .op-ceph-note[hidden] { display: none; }
.op-frontend .op-ceph-main {
    position: relative;
    flex: 1 1 0;
    display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr);
    gap: var(--op-sp-3);
    min-height: 0;
}
@media (min-width: 1024px) {
    .op-frontend .op-ceph-main { grid-template-columns: minmax(0, 1fr) 340px; }
}
.op-frontend .op-ceph-stagecol { display: flex; flex-direction: column; gap: var(--op-sp-2); min-width: 0; min-height: 0; }

/* The point he is on: its step, its name in his language with the abbreviation, its one line. */
.op-frontend .op-ceph-prompt {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-2) var(--op-sp-3);
    padding: var(--op-sp-2) var(--op-sp-3);
    border: 1px solid var(--op-border); border-radius: var(--op-radius-sm);
    background: var(--op-bg-alt);
}
.op-frontend .op-ceph-pbody { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.op-frontend .op-ceph-pstep { font-size: 12px; line-height: 16px; color: var(--op-text-muted); }
.op-frontend .op-ceph-pname { font-size: 16px; line-height: 22px; font-weight: 600; }
.op-frontend .op-ceph-pline { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 var(--op-sp-2); min-width: 0; }
.op-frontend .op-ceph-pen { font-size: 13px; line-height: 18px; font-weight: 600; color: var(--op-text-muted); unicode-bidi: isolate; }
.op-frontend .op-ceph-pdef { font-size: 13px; line-height: 18px; color: var(--op-text-muted); }
.op-frontend .op-ceph-pacts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-1); }
.op-frontend .op-ceph-pacts .op-btn { min-height: 44px; display: inline-flex; align-items: center; gap: var(--op-sp-1); }
.op-frontend .op-ceph-pacts [hidden] { display: none; }
.op-frontend .op-ceph-modal.is-readonly .op-ceph-pacts { display: none; }
.op-frontend .op-ceph-calrow { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-2); }
.op-frontend .op-ceph-calrow[hidden] { display: none; }
.op-frontend .op-ceph-callabel { font-size: 14px; font-weight: 500; }
.op-frontend .op-ceph-calin { display: inline-flex; align-items: center; gap: var(--op-sp-1); }
.op-frontend .op-ceph-calmm {
    width: 96px; min-height: 44px; padding: 0 var(--op-sp-2);
    border: 1px solid var(--op-border-strong); border-radius: var(--op-radius-sm);
    background: var(--op-surface); color: var(--op-text);
    font: inherit; font-size: 16px;   /* a phone does not zoom into it */
}
.op-frontend .op-ceph-calunit { font-size: 14px; color: var(--op-text-muted); }
.op-frontend .op-ceph-calset { min-height: 44px; }

/* The film: dark behind it, as on a viewing box; the world inside is zoomed and moved by the script. */
.op-frontend .op-ceph-view {
    position: relative;
    flex: 1 1 0; min-height: 160px;
    overflow: hidden;
    direction: ltr;                     /* the film is never mirrored */
    border-radius: var(--op-radius-sm);
    background: var(--op-ink-black);
    touch-action: none;                 /* a finger places a point: no scroll, no zoom of the page */
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none;
    cursor: crosshair;
}
.op-frontend .op-ceph-modal.is-readonly .op-ceph-view { cursor: grab; }
.op-frontend .op-ceph-world { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.op-frontend .op-ceph-film { position: absolute; left: 0; top: 0; overflow: hidden; }
.op-frontend .op-ceph-img {
    position: absolute; left: 0; top: 0;
    max-width: none; max-height: none;
    transform-origin: 0 0;
    pointer-events: none;
    -webkit-user-drag: none;
}
.op-frontend .op-ceph-ov { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.op-frontend .op-ceph-loupe {
    position: absolute; top: 8px; left: 8px; z-index: 3;
    width: 140px; height: 140px;
    border: 2px solid var(--op-ink-white); border-radius: 50%;
    overflow: hidden;
    background: var(--op-ink-black);
    box-shadow: var(--op-shadow-lg);
    pointer-events: none;
}
.op-frontend .op-ceph-loupe.is-right { left: auto; right: 8px; }
.op-frontend .op-ceph-loupe[hidden] { display: none; }
.op-frontend .op-ceph-cross { position: absolute; inset: 0; pointer-events: none; }
.op-frontend .op-ceph-cross::before,
.op-frontend .op-ceph-cross::after {
    content: ''; position: absolute; left: 50%; top: 50%;
    background: var(--op-ink-white);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .55);
}
.op-frontend .op-ceph-cross::before { width: 28px; height: 1px; margin: 0 0 0 -14px; }
.op-frontend .op-ceph-cross::after { width: 1px; height: 28px; margin: -14px 0 0 0; }
.op-frontend .op-ceph-view .op-ceph-status {
    position: absolute; inset: auto 0 0 0; z-index: 2; margin: 0;
    padding: var(--op-sp-2); text-align: center;
    background: var(--op-surface); color: var(--op-text-muted); font-size: 13px;
}
.op-frontend .op-ceph-view .op-ceph-status[hidden] { display: none; }
.op-frontend .op-ceph-imgpanel {
    position: absolute; top: 8px; right: 8px; z-index: 4;
    width: min(300px, calc(100% - 16px));
    display: flex; flex-direction: column; gap: var(--op-sp-1);
    padding: var(--op-sp-2) var(--op-sp-3);
    border: 1px solid var(--op-border-strong); border-radius: var(--op-radius-sm);
    background: var(--op-surface); box-shadow: var(--op-shadow-lg);
    color: var(--op-text);
    cursor: default;
}
[dir="rtl"] .op-frontend .op-ceph-imgpanel, .op-frontend[dir="rtl"] .op-ceph-imgpanel { direction: rtl; }
.op-frontend .op-ceph-imgpanel[hidden] { display: none; }
.op-frontend .op-ceph-range { display: flex; flex-direction: column; font-size: 13px; color: var(--op-text-muted); }
.op-frontend .op-ceph-range input { width: 100%; min-height: 44px; margin: 0; accent-color: var(--op-primary); }
.op-frontend .op-ceph-imgrow { display: flex; flex-wrap: wrap; gap: var(--op-sp-2); }
.op-frontend .op-ceph-imgnote { margin: 0; font-size: 12px; line-height: 16px; color: var(--op-text-muted); }
/* "Suggest the points": the models to ask, one by one or all at once (each with its marker on the film). */
.op-frontend .op-ceph-sugmenu {
    position: absolute; top: 8px; right: 8px; z-index: 4;
    width: min(320px, calc(100% - 16px)); max-height: calc(100% - 16px); overflow-y: auto;
    display: flex; flex-direction: column; gap: var(--op-sp-1);
    padding: var(--op-sp-2) var(--op-sp-3);
    border: 1px solid var(--op-border-strong); border-radius: var(--op-radius-sm);
    background: var(--op-surface); box-shadow: var(--op-shadow-lg);
    color: var(--op-text); cursor: default;
}
[dir="rtl"] .op-frontend .op-ceph-sugmenu, .op-frontend[dir="rtl"] .op-ceph-sugmenu { direction: rtl; right: auto; left: 8px; }
.op-frontend .op-ceph-sugmenu[hidden] { display: none; }
.op-frontend .op-ceph-sughead { margin: 0; font-size: 13px; font-weight: 600; color: var(--op-text-muted); }
.op-frontend .op-ceph-model { justify-content: flex-start; width: 100%; text-align: start; flex-wrap: wrap; }
.op-frontend .op-ceph-mname { flex: 1 1 auto; min-width: 0; font-weight: 600; }
.op-frontend .op-ceph-mver { font-weight: 400; color: var(--op-text-muted); unicode-bidi: isolate; }
.op-frontend .op-ceph-mwhere { flex: 0 0 auto; font-size: 12px; color: var(--op-text-muted); }
.op-frontend .op-ceph-sugmenu .op-ceph-allmodels { width: 100%; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.op-frontend .op-ceph-sugnote { margin: 0; font-size: 12px; line-height: 16px; color: var(--op-text-muted); }
/* fix/ceph24 (M24-44): what happens to the points already there, under the menu's head. */
.op-frontend .op-ceph-sugkeeps { margin: 0; font-size: 12px; line-height: 16px; color: var(--op-text-muted); max-width: 32em; }
.op-frontend .op-ceph-mkicon { flex: 0 0 auto; width: 16px; height: 16px; }
/* The markers on the film and the dotted spread around their median are drawn, not pointed at. */
.op-frontend .op-ceph-ov .op-ceph-mk, .op-frontend .op-ceph-ov .op-ceph-spread { pointer-events: none; }
.op-frontend .op-ceph-ov .is-uncertain { stroke-width: 3px; }
/* Which marker is which model, above the list while the markers are on the film. */
.op-frontend .op-ceph-legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-1) var(--op-sp-3); margin: 0 0 var(--op-sp-2); font-size: 12px; color: var(--op-text-muted); }
.op-frontend .op-ceph-legend[hidden] { display: none; }
.op-frontend .op-ceph-leghead { font-weight: 600; }
.op-frontend .op-ceph-legitem { display: inline-flex; align-items: center; gap: 4px; }
.op-frontend .op-ceph-hint { margin: 0; text-align: center; font-size: 13px; line-height: 18px; color: var(--op-text-muted); }
.op-frontend .op-ceph-hint:empty { display: none; }

.op-frontend .op-ceph-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--op-sp-2) var(--op-sp-4); }
.op-frontend .op-ceph-group { display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-1); }
/* fix/ceph24 (M24-43, M24-44): the named tools (Image, Calibrate (ruler on the film), Place points automatically) have
   their own line, above the icon tools, instead of breaking the row in three. */
@media (min-width: 600px) {
    .op-frontend .op-ceph-tools > .op-ceph-film-tools { order: -1; flex: 1 1 100%; justify-content: center; flex-wrap: nowrap; }
}
.op-frontend .op-ceph-group[hidden], .op-frontend .op-ceph-btn[hidden] { display: none; }
.op-frontend .op-ceph-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: var(--op-sp-1);
    min-width: 44px; min-height: 44px;
    padding: 0 var(--op-sp-2);
    border: 1px solid var(--op-border); border-radius: var(--op-radius-sm);
    background: var(--op-surface); color: var(--op-text);
    font: inherit; font-size: 14px; cursor: pointer;
}
.op-frontend .op-ceph-btn:hover:not(:disabled) { border-color: var(--op-border-strong); background: var(--op-bg); }
.op-frontend .op-ceph-btn:focus-visible { outline: 2px solid var(--op-primary); outline-offset: 2px; }
.op-frontend .op-ceph-btn:disabled { opacity: .45; cursor: default; }
.op-frontend .op-ceph-btn:is([aria-pressed="true"], [aria-expanded="true"]) {
    border-color: var(--op-primary);
    background: var(--op-primary-light);
    color: var(--op-primary);
    box-shadow: inset 0 0 0 1px var(--op-primary);
}
.op-frontend .op-ceph-x { border-color: transparent; }
.op-frontend .op-ceph-btn .op-ceph-ic { width: 20px; height: 20px; }
[dir="rtl"] .op-frontend .op-ceph-flip, .op-frontend[dir="rtl"] .op-ceph-flip { transform: scaleX(-1); }   /* undo points back, to the start of the line */

/* The points and the live readings: beside the film on a computer, a panel over it on a tablet and a phone. */
.op-frontend .op-ceph-main > .op-ceph-side {
    display: flex; flex-direction: column; gap: var(--op-sp-2);
    min-height: 0; overflow-y: auto;
    padding-inline-end: var(--op-sp-1);
}
.op-frontend .op-ceph-sidehead { margin: var(--op-sp-1) 0 0; font-size: 14px; line-height: 20px; font-weight: 600; }
.op-frontend .op-ceph-sidetop { display: flex; align-items: center; justify-content: space-between; gap: var(--op-sp-2); }
.op-frontend .op-ceph-sideclose { display: none; }
.op-frontend .op-ceph-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.op-frontend .op-ceph-listhead { margin: var(--op-sp-2) 0 2px; font-size: 12px; color: var(--op-text-muted); }
.op-frontend .op-ceph-pick {
    display: flex; align-items: center; gap: var(--op-sp-2);
    width: 100%; min-height: 44px;
    padding: 4px var(--op-sp-2);
    border: 1px solid transparent; border-radius: var(--op-radius-sm);
    background: transparent; color: var(--op-text);
    font: inherit; font-size: 14px; line-height: 18px; text-align: start;
    cursor: pointer;
}
.op-frontend .op-ceph-pick:hover:not(:disabled) { background: var(--op-bg); }
.op-frontend .op-ceph-pick:focus-visible { outline: 2px solid var(--op-primary); outline-offset: 1px; }
.op-frontend .op-ceph-pick:disabled { cursor: default; }
.op-frontend .op-ceph-item.is-now .op-ceph-pick { border-color: var(--op-primary); background: var(--op-primary-light); }
.op-frontend .op-ceph-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--op-border-strong); box-sizing: border-box; }
.op-frontend .op-ceph-item.is-placed .op-ceph-dot { background: var(--op-tracing-point); border-color: var(--op-tracing-point); }
.op-frontend .op-ceph-item.is-now .op-ceph-dot { border-color: var(--op-primary); background: var(--op-surface); }
.op-frontend .op-ceph-item.is-proposed .op-ceph-dot { border-style: dashed; border-color: var(--op-tracing-proposed); }
/* The models disagree on it: asked first, said so in the warning colours. */
.op-frontend .op-ceph-item.is-uncertain .op-ceph-dot { border-style: dashed; border-color: var(--op-warning-text); }
.op-frontend .op-ceph-item.is-uncertain .op-ceph-said { color: var(--op-warning-text); font-weight: 600; }
.op-frontend .op-ceph-item.is-uncertain .op-ceph-pick, .op-frontend .op-ceph-item.is-uncertain-now .op-ceph-pick { background: var(--op-warning-bg); }
/* fix/ceph18 review (F4): one our model is often off on (its test-set error): checked right after the uncertain ones. */
.op-frontend .op-ceph-item.is-weak .op-ceph-dot { border-style: dashed; border-color: var(--op-warning-text); }
.op-frontend .op-ceph-item.is-weak .op-ceph-said { color: var(--op-warning-text); }
.op-frontend .op-ceph-listhead.is-first { margin-top: 0; font-weight: 600; color: var(--op-text); }
.op-frontend .op-ceph-abbr { flex: 0 0 3.4em; font-weight: 600; direction: ltr; unicode-bidi: isolate; text-align: start; }
.op-frontend .op-ceph-pn { flex: 1 1 auto; min-width: 0; }
.op-frontend .op-ceph-said { flex: 0 0 auto; font-size: 12px; color: var(--op-text-muted); }
.op-frontend .op-ceph-calstate { margin: 0; font-size: 13px; line-height: 18px; color: var(--op-text-muted); }
.op-frontend .op-ceph-live .op-ceph-table { font-size: 13px; }
.op-frontend .op-ceph-sidetoggle { display: none; }

.op-frontend .op-ceph-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--op-sp-2); }
.op-frontend .op-ceph-foot .op-btn { min-height: 44px; display: inline-flex; align-items: center; gap: var(--op-sp-1); }
.op-frontend .op-ceph-foot .op-btn[hidden] { display: none; }
.op-frontend .op-ceph-foot .op-ceph-ic { width: 18px; height: 18px; }

.op-frontend .op-ceph-ask {
    position: absolute; inset: auto var(--op-sp-4) var(--op-sp-4) var(--op-sp-4); z-index: 6;
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--op-sp-3);
    padding: var(--op-sp-3) var(--op-sp-4);
    border: 1px solid var(--op-border-strong); border-radius: var(--op-radius);
    background: var(--op-surface); box-shadow: var(--op-shadow-lg);
}
.op-frontend .op-ceph-ask[hidden] { display: none; }
.op-frontend .op-ceph-ask-text { margin: 0; font-weight: 600; }
.op-frontend .op-ceph-ask-btns { display: flex; flex-wrap: wrap; gap: var(--op-sp-2); margin-inline-start: auto; }
.op-frontend .op-ceph-ask-btns .op-btn { min-height: 44px; }
.op-frontend .op-ceph-askno { padding: 0 var(--op-sp-3); }
.op-frontend .op-ceph-askyes { min-width: 44px; }

/* A tablet and a phone: the points and readings are a panel over the film, opened from "Points and readings". */
@media (max-width: 1023px) {
    .op-frontend .op-ceph-main > .op-ceph-side {
        position: absolute; inset: 0; z-index: 5;
        display: none;
        padding: var(--op-sp-2) var(--op-sp-3);
        border: 1px solid var(--op-border-strong); border-radius: var(--op-radius-sm);
        background: var(--op-surface); box-shadow: var(--op-shadow-lg);
    }
    .op-frontend .op-ceph-modal.is-side-open .op-ceph-main > .op-ceph-side { display: flex; }
    .op-frontend .op-ceph-sideclose { display: inline-flex; border-color: transparent; }
    .op-frontend .op-ceph-sidetop { position: sticky; top: calc(-1 * var(--op-sp-2)); z-index: 1; background: var(--op-surface); }
    .op-frontend .op-ceph-sidetoggle { display: flex; }
    .op-frontend .op-ceph-tools .op-ceph-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* fix/ceph24 (M24-43, M24-44): on a tablet and a phone too, Calibrate and Place points automatically keep their words
   ("not an icon only"). */
@media (max-width: 1023px) {
    .op-frontend .op-ceph-tools :is(.op-ceph-calbtn, .op-ceph-suggest) .op-ceph-name { position: static; width: auto; height: auto; overflow: visible; clip: auto; white-space: nowrap; }
}
/* fix/ceph24 review (M24-44): a phone gives them their own line, side by side, the words on two lines inside the button. */
@media (max-width: 599px) {
    .op-frontend .op-ceph-tools > .op-ceph-film-tools { order: -1; flex: 1 1 100%; justify-content: center; flex-wrap: nowrap; }
    .op-frontend .op-ceph-tools :is(.op-ceph-calbtn, .op-ceph-suggest) { flex: 1 1 0; min-width: 0; padding-block: 2px; }
    .op-frontend .op-ceph-tools :is(.op-ceph-calbtn, .op-ceph-suggest) .op-ceph-name { white-space: normal; font-size: 13px; line-height: 16px; text-align: center; }
    .op-frontend .op-ceph-tools :is(.op-ceph-calbtn, .op-ceph-suggest) .op-ceph-ic { flex: 0 0 auto; }
}
/* fix/ceph24 (M24-45): one run at a time — ✦ busy while the model runs. */
.op-frontend .op-ceph-suggest.is-busy { opacity: .6; cursor: progress; }
/* fix/ceph24 (M24-43): Set waits for a length. */
.op-frontend .op-ceph-calset:disabled { opacity: .5; cursor: not-allowed; }
@media (min-width: 1024px) {
    .op-frontend .op-ceph-tools .op-ceph-listbtn { display: none; }
}
/* A phone: the whole screen, the film first, the tools under it within reach of the thumb. */
@media (max-width: 767px) {
    .op-frontend .op-ceph-modal { align-items: stretch; }
    .op-frontend .op-ceph-box {
        width: 100vw; height: 100vh; height: 100dvh;
        gap: var(--op-sp-1);
        padding: var(--op-sp-2) var(--op-sp-2) calc(var(--op-sp-2) + env(safe-area-inset-bottom, 0px));
        border-radius: 0;
    }
    .op-frontend .op-ceph-title { font-size: 16px; line-height: 22px; }
    .op-frontend .op-ceph-prompt { padding: var(--op-sp-1) var(--op-sp-2); gap: var(--op-sp-1) var(--op-sp-2); }
    .op-frontend .op-ceph-pname { font-size: 15px; line-height: 20px; }
    .op-frontend .op-ceph-pdef { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .op-frontend .op-ceph-hint { font-size: 12px; line-height: 16px; }
    .op-frontend .op-ceph-tools { gap: var(--op-sp-1) var(--op-sp-2); }
    .op-frontend .op-ceph-loupe { width: 120px; height: 120px; }
    .op-frontend .op-ceph-foot .op-btn { flex: 1 1 0; justify-content: center; }
    .op-frontend .op-ceph-ask { inset: auto var(--op-sp-2) var(--op-sp-2) var(--op-sp-2); }
    .op-frontend .op-ceph-table th, .op-frontend .op-ceph-table td { padding: 6px 3px; }
    .op-frontend .op-ceph-table { font-size: 13px; line-height: 18px; }
}
/* A phone held sideways: no hint, the definition on one line, so the film keeps its height. */
@media (max-height: 540px) and (orientation: landscape) {
    .op-frontend .op-ceph-hint { display: none; }
    .op-frontend .op-ceph-pdef { -webkit-line-clamp: 1; }
    .op-frontend .op-ceph-box { padding-top: var(--op-sp-1); }
}

@media print {
    .op-frontend .op-ceph-modal { display: none !important; }
    .op-frontend .op-ceph-actions, .op-frontend .op-ceph-analyse { display: none; }
}

/*
 * fix/cephpolish (P8): the chip he chose is the ceph's proposal — the line under
 * the row ("From the ceph: ANB 6.0° → C2") is no longer a proposal's key: no
 * dot, in the hint's own colour (op-components.css draws the key in the
 * warning tone with its dot, for a chip still proposed).
 */
.op-frontend .op-field.op-ceph-taken .op-chip-proposed-key,
.op-ds .op-field.op-ceph-taken .op-chip-proposed-key { color: var(--op-text-muted); }
.op-frontend .op-field.op-ceph-taken .op-chip-proposed-key::before { content: none; }

/* ==========================================================================
   fix/ceph18 (18 Nov, W18-01..03, C17-DIA-03): the Eastman analysis, the
   points the model places by itself, the card on Patient Photos only.
   Calm as the rest: the analysis' green and red are status WORDS (the
   Meaning column, the severity stars), never a fill; "placed automatically"
   is a one-line info notice and a small dashed ring, the hollow dashed point
   of the film in the table's own ink.
   ========================================================================== */

/* The card on Patient Photos, right under the X-rays card that holds the film. */
.op-frontend .op-upload-group[data-group="xrays"] + .op-ceph-card { margin-top: var(--op-sp-4); }

/* "Placed automatically by OrthoPlan Ceph model 1.0.0 — check the points: 22 still to check." */
.op-frontend .op-ceph-autoline {
    margin: 0 0 var(--op-sp-3);
    padding: var(--op-sp-2) var(--op-sp-3);
    border-radius: var(--op-radius-sm);
    background: var(--op-info-bg); color: var(--op-info-text);
    font-size: 13px; line-height: 18px;
}
.op-frontend .op-ceph-autoline[hidden],
.op-frontend .op-ceph-runstate[hidden] { display: none; }
.op-frontend .op-ceph-runstate { margin: var(--op-sp-2) 0 0; font-size: 13px; line-height: 18px; color: var(--op-text-muted); }
.op-frontend .op-ceph-open[aria-busy="true"] { cursor: progress; opacity: .75; }
.op-frontend .op-ceph-manual { white-space: nowrap; }

/* A reading from a point the model placed, not checked yet: a small dashed ring, the film's hollow point. */
.op-frontend .op-ceph-auto {
    display: inline-block; flex: none;
    width: 9px; height: 9px; margin-inline-start: 4px;
    border: 1.5px dashed currentColor; border-radius: 50%;
    vertical-align: -1px; color: var(--op-text-soft);
}
.op-frontend .op-ceph-autonote { margin: var(--op-sp-2) 0 0; font-size: 12px; line-height: 17px; color: var(--op-text-muted); }
.op-frontend .op-ceph-autonote .op-ceph-auto { margin-inline: 0 2px; }

/* His Eastman table: Reading | Mean | S.D. | Result | Severity | Meaning. */
.op-frontend .op-ceph-table.is-eastman .op-ceph-num { text-align: end; white-space: nowrap; }
.op-frontend .op-ceph-table.is-eastman :is(.op-ceph-mean, .op-ceph-sd) { color: var(--op-text-muted); }
.op-frontend .op-ceph-table.is-eastman :is(.op-ceph-mean, .op-ceph-sd) bdi { unicode-bidi: isolate; direction: ltr; }
.op-frontend .op-ceph-table.is-eastman .op-ceph-sev { white-space: nowrap; min-width: 2.2em; }
.op-frontend .op-ceph-stars { color: var(--op-danger-text); font-weight: 600; letter-spacing: 1px; }
.op-frontend .op-ceph-meaning.is-normal { color: var(--op-success-text); }
.op-frontend .op-ceph-meaning.is-out { color: var(--op-danger-text); font-weight: 500; }
.op-frontend .op-ceph-meaning .op-ceph-why { color: var(--op-text-soft); }
/*
 * Narrower than six whole columns (a phone, a tablet in portrait in Arabic,
 * the editor's side panel): each reading on three lines — its name; its
 * mean, S.D., result and severity in four even columns; its meaning — so no
 * value is split and nothing runs out of the card.
 */
@container (max-width: 520px) {
    .op-frontend .op-ceph-table.is-eastman, .op-frontend .op-ceph-table.is-eastman > :is(thead, tbody) { display: block; }
    .op-frontend .op-ceph-table.is-eastman tr { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--op-sp-2); border-bottom: 1px solid var(--op-border); }
    .op-frontend .op-ceph-table.is-eastman :is(th, td) { display: block; border-bottom: 0; padding: 2px 0; }
    .op-frontend .op-ceph-table.is-eastman tr > :first-child { grid-column: 1 / -1; padding-top: 6px; }
    .op-frontend .op-ceph-table.is-eastman tr > :last-child { grid-column: 1 / -1; padding-bottom: 6px; }
    .op-frontend .op-ceph-table.is-eastman .op-ceph-num { text-align: start; }
}

/* The editor's "Confirm all": beside Save, while a point is still as the model placed it. */
.op-frontend .op-ceph-confirmall { white-space: nowrap; }

/* Diagnosis: the one short link to the analysis on Patient Photos (W18-03). */
.op-frontend .op-ceph-dxlink { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--op-sp-3); margin: var(--op-sp-2) 0 0; }
.op-frontend .op-ceph-dxlink .op-goto-step { display: inline-flex; align-items: center; gap: var(--op-sp-1); min-height: 44px; font-weight: 500; color: var(--op-primary); text-decoration: none; }
.op-frontend .op-ceph-dxlink .op-goto-step:hover { text-decoration: underline; }
.op-frontend .op-ceph-dxlink .op-field-hint { margin: 0; }
.op-frontend .op-ceph-dxlink[hidden], .op-frontend .op-ceph-dxlink .op-field-hint[hidden] { display: none; }
@media print {
    .op-frontend .op-ceph-dxlink { display: none; }
}
.op-frontend .op-ceph-startline { margin: 0; font-size: 13px; line-height: 18px; color: var(--op-text-muted); }
/* ---- end fix/ceph18 ---- */

/* ==========================================================================
   fix/ceph22 (22 Nov, W22-02): the Eastman sheet — the traced film and the
   table as one sheet, one tap from the card; the whole screen on a phone; on
   paper the sheet alone. W22-01: the polygonal chart's rules are gone.
   ========================================================================== */
.op-frontend .op-ceph-sheetbtn { white-space: nowrap; }
html.op-ceph-sheet-open, html.op-ceph-sheet-open body { overflow: hidden; }
.op-frontend.op-ceph-sheet {
    position: fixed; inset: 0; z-index: 2001;
    display: flex; flex-direction: column;
    background: var(--op-bg-alt); color: var(--op-text);
    /* The sheet carries the page's frontend class for its look, not the page's own frame (its width, padding, height). */
    box-sizing: border-box; max-width: none !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
}
.op-frontend .op-ceph-sheetbar {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-2) var(--op-sp-3);
    padding: var(--op-sp-2) var(--op-sp-4);
    border-bottom: 1px solid var(--op-border);
    background: var(--op-surface);
}
.op-frontend .op-ceph-sheettitle { flex: 1 1 auto; min-width: 0; margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; }
.op-frontend .op-ceph-sheetacts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-2); }
.op-frontend .op-ceph-sheetacts .op-btn { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; gap: var(--op-sp-1); white-space: nowrap; }
.op-frontend .op-ceph-sheetscroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--op-sp-4); }
.op-frontend .op-ceph-sheetpage {
    max-width: 760px; margin: 0 auto;
    padding: var(--op-sp-4);
    border: 1px solid var(--op-border); border-radius: var(--op-radius-lg);
    background: var(--op-surface);
}
.op-frontend .op-ceph-sheethead { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--op-sp-1) var(--op-sp-3); margin: 0 0 var(--op-sp-3); }
.op-frontend .op-ceph-sheetwho { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; }
.op-frontend .op-ceph-sheetdate { margin: 0; font-size: 13px; line-height: 22px; color: var(--op-text-muted); }
.op-frontend .op-ceph-sheetauto {
    margin: 0 0 var(--op-sp-3);
    padding: var(--op-sp-2) var(--op-sp-3);
    border-radius: var(--op-radius-sm);
    background: var(--op-info-bg); color: var(--op-info-text);
    font-size: 13px; line-height: 18px;
}
.op-frontend .op-ceph-sheetfig { margin: 0; direction: ltr; border-radius: var(--op-radius-sm); overflow: hidden; background: var(--op-bg-alt); break-inside: avoid; page-break-inside: avoid; }
.op-frontend .op-ceph-sheetsrc { margin: var(--op-sp-3) 0 var(--op-sp-2); font-size: 12px; line-height: 17px; color: var(--op-text-muted); }
.op-frontend .op-ceph-sheettable { container-type: inline-size; min-width: 0; }
@media (max-width: 767px) {
    .op-frontend .op-ceph-sheetbar { padding: var(--op-sp-2) var(--op-sp-3); }
    .op-frontend .op-ceph-sheettitle { font-size: 16px; line-height: 22px; flex-basis: 100%; }
    .op-frontend .op-ceph-sheetacts { flex: 1 1 100%; }
    .op-frontend .op-ceph-sheetacts .op-ceph-sheetprint, .op-frontend .op-ceph-sheetacts .op-ceph-sheetdl { flex: 1 1 0; }
    .op-frontend .op-ceph-sheetscroll { padding: var(--op-sp-2); }
    .op-frontend .op-ceph-sheetpage { padding: var(--op-sp-3); border-radius: var(--op-radius-sm); }
}
/* On paper (Print, or the browser's own print while it is open): the sheet alone, as his report — no bar, no frame, nothing of the page under it. */
@media print {
    html.op-ceph-sheet-open body > :not(.op-ceph-sheet) { display: none !important; }
    html.op-ceph-sheet-open, html.op-ceph-sheet-open body { overflow: visible; background: none; }
    .op-frontend.op-ceph-sheet { position: static; display: block; background: none; }
    .op-frontend .op-ceph-sheetbar { display: none; }
    .op-frontend .op-ceph-sheetscroll { overflow: visible; padding: 0; }
    .op-frontend .op-ceph-sheetpage { max-width: none; padding: 0; border: 0; }
    .op-frontend .op-ceph-sheetfig { max-width: 150mm; margin: 0 auto; }
    .op-frontend .op-ceph-sheettable tr { break-inside: avoid; page-break-inside: avoid; }
}
/* ---- end fix/ceph22 ---- */
