/* ============================================================
   OrthoPlan Pro — the Treatment Plan step (6 Nov 2026, package PLN)
   Loaded after public.css (OrthoPlan_Public::module_assets()).
   Tokens only, logical properties only: it is read in Arabic too.
   Structure and the few marks the plan needs; package S restyles the
   containers through the design layer.
   ============================================================ */

/* ---------- The plan's versions (R-PLN-01; fix/ver R11-PLN-01…04) ----------
   One line for the label and the buttons of the version in view (Reset and
   Modify on the Active one, Make active and Delete on a draft), then the
   versions on a row of their own, so a third or fourth one never pushes a
   button onto a line by itself. The Active version is drawn as chosen and
   labelled Active; the one in view carries a tab line under it. */
.op-frontend .op-plan-versions {
    display: flex;
    flex-direction: column;
    gap: var(--op-sp-2);
}
.op-frontend .op-plan-versions-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--op-sp-2);
}
.op-frontend .op-plan-version-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--op-sp-2);
    margin-inline-start: auto;
}
.op-frontend .op-plan-version-actions .op-btn { display: inline-flex; align-items: center; gap: 6px; }
.op-frontend .op-plan-modify { min-height: 36px; }
.op-frontend .op-plan-modify:disabled { opacity: .55; cursor: not-allowed; }
.op-frontend .op-plan-delete { color: var(--op-danger-text); }
.op-frontend .op-plan-version-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: var(--op-sp-2);
}
.op-frontend .op-plan-version { margin: 0; min-width: 0; }
.op-frontend .op-plan-version-link {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 44px;
    padding: 6px var(--op-sp-3) 8px;
    border: 1px solid var(--op-border-strong);
    border-radius: var(--op-radius);
    background: var(--op-surface);
    color: var(--op-text);
    font-size: 13px;
    text-decoration: none;
    max-width: 100%;
    box-sizing: border-box;
}
.op-frontend .op-plan-version-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.op-frontend .op-plan-version-sub { font-size: 12px; color: var(--op-text-muted); }
.op-frontend .op-plan-version.is-frozen .op-plan-version-link { border-style: dashed; color: var(--op-text-muted); }
.op-frontend .op-plan-version.is-frozen .op-plan-version-link b { color: var(--op-text); }
/* The Active plan: drawn as chosen, wherever the doctor is looking. */
.op-frontend .op-plan-version.is-working .op-plan-version-link {
    border-color: var(--op-primary);
    box-shadow: inset 0 0 0 1px var(--op-primary);
    background: var(--op-primary-light);
}
/* The one on screen: a tab line under it, never the Active plan's colour. */
.op-frontend .op-plan-version.is-viewing .op-plan-version-link::after {
    content: "";
    position: absolute;
    inset-inline: 10px;
    bottom: -6px;
    height: 3px;
    border-radius: 3px;
    background: var(--op-text);
}
.op-frontend .op-plan-version-kind,
.op-frontend .op-plan-version-date { color: var(--op-text-muted); white-space: nowrap; }
.op-frontend .op-plan-version-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 0 8px;
    border-radius: var(--op-radius-pill);
    background: var(--op-bg-alt);
    font-size: 11px;
    font-weight: 600;
    line-height: 18px;
    color: var(--op-text-muted);
}
.op-frontend .op-plan-version-tag.is-active { background: var(--op-primary); color: var(--op-primary-text); }
.op-frontend .op-plan-versions-full { margin: 0; font-size: 13px; }

.op-frontend .op-plan-frozen-banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: var(--op-sp-2);
}
.op-frontend .op-plan-frozen-banner > span { flex: 1 1 16em; }
.op-frontend .op-plan-back { white-space: normal; text-align: start; }
.op-frontend .op-plan-version-sep { color: var(--op-text-soft); }
/* fix/ver: "from Treatment Plan 3" beside "No longer in the plan" on the Lab tab, on one line. */
.op-frontend .op-lab-from { white-space: nowrap; }
/* A draft is drawn by the same form, read-only, and posts nowhere. */
.op-frontend .op-plan-frozen-form { opacity: .96; }
/* fix/ver (review, Q11-03): "from a deleted plan version" on a visit card, in the amber of "No longer in the plan". */
.op-frontend .op-visit-from { background: var(--op-warning-bg); color: var(--op-warning-text); white-space: normal; }
.op-ds .op-visit-from { background: var(--ds-sunken); color: var(--ds-warning-text); height: auto; min-height: 22px; white-space: normal; }
.op-ds .op-visit-from::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: none; background: var(--ds-warning); }
/* On a phone the flag goes under the visit's name, never squeezing "Follow-up 1" onto two lines. */
.op-frontend .op-visit-title:has(.op-visit-from) { flex-wrap: wrap; row-gap: 4px; }
.op-frontend .op-visit-title:has(.op-visit-from) .op-visit-no { white-space: nowrap; }

/* fix/ver: the two line icons this package needs that the calm set has not (Lucide trash-2, columns-2). */
.op-ds .op-ic-trash { --op-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18' /%3E%3Cpath d='M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6' /%3E%3Cpath d='M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2' /%3E%3Cline x1='10' x2='10' y1='11' y2='17' /%3E%3Cline x1='14' x2='14' y1='11' y2='17' /%3E%3C/svg%3E"); }
.op-ds .op-ic-columns { --op-ic: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='18' x='3' y='3' rx='2' /%3E%3Cpath d='M12 3v18' /%3E%3C/svg%3E"); }

/* The plan in one line, above its summary (R-PLN-20). */
.op-frontend .op-plan-headline {
    margin: 0 0 var(--op-sp-2);
    font-weight: 700;
    color: var(--op-text);
}

/* ---------- Stages first, and the two phases (R-PLN-03, R-PLN-04) ---------- */
.op-frontend .op-phase-block {
    margin-top: var(--op-sp-3);
    padding: var(--op-sp-3);
    border-radius: var(--op-radius);
    border: 1px solid var(--op-border);
}
/* 1st phase: the removable / functional appliance, in the gold of the accent. */
.op-frontend .op-phase-block.op-phase-1 {
    background: var(--op-accent-light);
    border-inline-start: 4px solid var(--op-accent);
}
.op-frontend .op-phase-label {
    display: inline-block;
    margin-bottom: var(--op-sp-2);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--op-accent-text);
}
.op-frontend .op-phase-label-2 { color: var(--op-primary-dark); }
/* 2nd phase: the whole line-of-treatment sequence, in the primary teal. */
.op-frontend .op-plan-line.is-two-phase {
    padding: var(--op-sp-3);
    border-radius: var(--op-radius-md);
    background: var(--op-primary-light);
    border-inline-start: 4px solid var(--op-primary);
    margin-bottom: var(--op-sp-4);
}
.op-frontend .op-plan-line.is-two-phase > .op-card:last-child { margin-bottom: 0; }
.op-frontend .op-fsec-stages .op-field-chips { margin-bottom: 0; }
.op-frontend .op-plan-braces,
.op-frontend .op-plan-step { min-width: 0; }
.op-frontend .op-plan-instructions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--op-sp-2);
    margin-top: var(--op-sp-2);
}

/* A chart inside a space-provision detail (a grid) scrolls inside its own box
   on a phone instead of widening the page: grid items do not shrink below
   their content unless told to. */
.op-frontend .op-sp-detail > .op-field { min-width: 0; }

/* ---------- Teeth to extract fill red; teeth to derotate violet (R-PLN-11, R-PLN-14) ----------
   Red means "no bracket on this tooth" (R-SYS-11): the PDF's "To extract".
   Never the teal of a plain selection, and the number and the readout say it too. */
.op-frontend .op-toothchart.op-tc-sel-danger .op-tc-tooth.is-on .op-tc-crown {
    fill: var(--op-mark-extract);
    stroke: var(--op-danger-text);
}
.op-frontend .op-toothchart.op-tc-sel-danger .op-tc-tooth.is-on .op-tc-num { color: var(--op-danger-text); }
.op-frontend .op-toothchart.op-tc-sel-danger .op-tc-readout { color: var(--op-danger-text); }
.op-frontend .op-toothchart.op-tc-sel-rotation .op-tc-tooth.is-on .op-tc-crown {
    fill: var(--op-mark-rotation);
    stroke: var(--op-pillar-dental);
}
.op-frontend .op-toothchart.op-tc-sel-rotation .op-tc-tooth.is-on .op-tc-num,
.op-frontend .op-toothchart.op-tc-sel-rotation .op-tc-readout { color: var(--op-pillar-dental); }

/* ---------- pln-space (11 Nov 2026): IPR on the drawn teeth, with the amount (R11-PLN-08) ----------
   The teeth of "Which teeth to extract", drawn, and a gap to tap between every
   two. The teeth are a picture (not buttons), so a gap's target reaches over
   half of each neighbour: 44 px on a touch screen or a phone, without the row
   growing, and never over the next gap's (the narrowest tooth plus a gap is
   wider than 44). The board scrolls inside its box on a phone and opens on
   the midline; it reads 18 … 28 left to right in Arabic too. */
.op-frontend .op-gapchart-field { min-width: 0; }
.op-frontend .op-gapchart {
    --op-gc-gap: 20px;
    --op-gc-hit: 28px;
    position: relative;
    min-width: 0;
    background: var(--op-surface);
    border: 1px solid var(--op-border);
    border-radius: var(--op-radius-md);
    padding: var(--op-sp-3) var(--op-sp-2) var(--op-sp-2);
}
@media (hover: none) and (pointer: coarse), (max-width: 640px) {
    .op-frontend .op-gapchart { --op-gc-gap: 22px; --op-gc-hit: 44px; }
}
.op-frontend .op-gc-board {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    direction: ltr;
    unicode-bidi: isolate;
    padding-bottom: var(--op-sp-1);
}
.op-frontend .op-gc-board.is-scrollable {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(to right, transparent 0, #000 28px, #000 calc(100% - 28px), transparent 100%);
}
.op-frontend .op-gc-board.is-scrollable.is-at-left {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent 100%);
}
.op-frontend .op-gc-board.is-scrollable.is-at-right {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent 100%);
            mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent 100%);
}
.op-frontend .op-gc-swipe { display: none; }
.op-frontend .op-gc-board.is-scrollable + .op-gc-swipe {
    display: block;
    padding: 2px var(--op-sp-1) 0;
    font-size: 12px;
    color: var(--op-text-muted);
    text-align: center;
}
.op-frontend .op-gc-row {
    display: flex;
    justify-content: center;
    width: max-content;
    min-width: 100%;
}
.op-frontend .op-gc-row-upper { align-items: flex-end; }
.op-frontend .op-gc-row-lower {
    align-items: flex-start;
    margin-top: 3px;
    padding-top: 3px;
    border-top: 1px dashed var(--op-border-strong);
}
.op-frontend .op-gc-tooth {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 0 0 auto;
    width: calc(var(--op-gc-w, 32px) * var(--op-gc-scale, 1));
    pointer-events: none;
}
.op-frontend .op-gc-row-lower .op-gc-tooth { flex-direction: column-reverse; }
.op-frontend .op-gc-svg {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 44 / 100;
    overflow: visible;
}
.op-frontend .op-gc-row-lower .op-gc-svg { transform: scaleY(-1); }
.op-frontend .op-gc-num {
    font-size: 11px;
    line-height: 1.5;
    color: var(--op-text-soft);
    font-variant-numeric: tabular-nums;
}

/* The gap: as wide as the room between two teeth, its target wider. */
.op-frontend .op-gc-gap {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    align-self: stretch;
    width: var(--op-gc-hit);
    margin: 0 calc((var(--op-gc-gap) - var(--op-gc-hit)) / 2);
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    border-radius: var(--op-radius-sm);
}
.op-frontend .op-gc-gap.is-midline { margin-inline: calc((var(--op-gc-gap) + 6px - var(--op-gc-hit)) / 2); }
.op-frontend .op-gc-gap:disabled { cursor: default; }
/* The contact: a short dashed line at the crowns, where the two teeth touch. */
.op-frontend .op-gc-line {
    position: absolute;
    inset-inline-start: 50%;
    width: 0;
    height: 30px;
    margin-inline-start: -1px;
    border-inline-start: 2px dashed var(--op-border-strong);
    transition: border-color .12s ease;
}
.op-frontend .op-gc-row-upper .op-gc-line { bottom: 22px; }
.op-frontend .op-gc-row-lower .op-gc-line { top: 22px; }
.op-frontend .op-gc-gap:not(:disabled):hover .op-gc-line,
.op-frontend .op-gc-gap.is-open .op-gc-line { border-color: var(--op-primary); border-style: solid; }
.op-frontend .op-gc-gap:focus-visible { outline: 2px solid var(--op-primary); outline-offset: -2px; }
/* Marked: a tag on the contact with the amount. */
.op-frontend .op-gc-amt {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    min-width: 26px;
    padding: 2px 4px;
    border-radius: var(--op-radius-pill);
    background: var(--op-primary);
    color: var(--op-primary-text, #fff);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    text-align: center;
    box-shadow: 0 0 0 2px var(--op-surface);
}
.op-frontend .op-gc-amt:empty { display: none; }
.op-frontend .op-gc-row-upper .op-gc-amt { bottom: 28px; }
.op-frontend .op-gc-row-lower .op-gc-amt { top: 28px; }
.op-frontend .op-gc-gap.is-on .op-gc-line { border-color: var(--op-primary); border-style: solid; border-inline-start-width: 3px; }
/* A gap marked before amounts were asked: marked, its amount still to choose. */
.op-frontend .op-gc-gap.is-on .op-gc-amt:empty { display: block; min-width: 12px; height: 12px; padding: 0; }
.op-frontend .op-gc-gap.is-open { background: var(--op-primary-light); }
/* fix/teeth18 (C17-PLN-06): the midline, a thin dashed line through both rows
   between 11 | 21 and 41 | 31, as on every drawn chart (public.css). The 11/21
   contact's own short IPR mark sits on it. Rows as wide as the widest, so the
   line is one line on a phone's scrolled board too. */
.op-frontend .op-gc-board { display: grid; grid-template-columns: minmax(max-content, 1fr); }
.op-frontend .op-gc-row { position: relative; }
.op-frontend .op-gc-row::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    border-left: 1px dashed var(--op-border-strong);
    pointer-events: none;
}
.op-frontend .op-gc-row-lower::after { top: -4px; }

.op-frontend .op-gc-readout {
    margin-top: var(--op-sp-2);
    padding-top: var(--op-sp-2);
    border-top: 1px solid var(--op-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--op-primary-dark);
    font-variant-numeric: tabular-nums;
}
.op-frontend .op-gc-readout:empty { border-top: 0; padding-top: 0; }

/* The amounts: a small sheet over the other arch, so the tapped gap stays in view. */
.op-frontend .op-gc-pop {
    position: absolute;
    z-index: 5;
    width: max-content;
    max-width: calc(100% - 16px);
    padding: var(--op-sp-3);
    background: var(--op-surface);
    border: 1px solid var(--op-border-strong);
    border-radius: var(--op-radius-md);
    box-shadow: var(--op-shadow-lg);
}
.op-frontend .op-gc-pop[hidden] { display: none; }
.op-frontend .op-gc-pop-t {
    margin: 0 0 var(--op-sp-2);
    font-size: 14px;
    font-weight: 700;
    color: var(--op-text);
}
.op-frontend .op-gc-pop-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: var(--op-sp-2);
}
.op-frontend .op-gc-amount {
    min-width: 64px;
    min-height: 44px;
    padding: 0 var(--op-sp-3);
    border: 1px solid var(--op-border-strong);
    border-radius: var(--op-radius-pill);
    background: var(--op-surface);
    color: var(--op-text);
    font-size: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    cursor: pointer;
    direction: ltr;
}
.op-frontend .op-gc-amount:hover { border-color: var(--op-primary); }
.op-frontend .op-gc-amount.is-active {
    border-color: var(--op-primary);
    background: var(--op-primary);
    color: var(--op-primary-text, #fff);
}
.op-frontend .op-gc-pop-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: var(--op-sp-2);
    margin-top: var(--op-sp-2);
}
.op-frontend .op-gc-pop-actions .op-btn { min-height: 44px; }
.op-frontend .op-gc-remove { color: var(--op-danger-text); }

/* ---------- pln-space: expansion in three folded kinds (R11-PLN-10) ---------- */
.op-frontend .op-exp-kinds {
    display: grid;
    gap: var(--op-sp-2);
    min-width: 0;
}
.op-frontend .op-exp-appliance,
.op-frontend .op-field-chips.op-exp-appliance { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--op-sp-2); margin-bottom: 0; min-width: 0; }
.op-frontend .op-exp-kind {
    border: 1px solid var(--op-border);
    border-radius: var(--op-radius-md);
    background: var(--op-surface);
    min-width: 0;
}
.op-frontend .op-exp-kind[open] { border-color: var(--op-border-strong); }
.op-frontend .op-exp-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px var(--op-sp-2);
    min-height: 48px;
    padding: 6px var(--op-sp-3);
    cursor: pointer;
    list-style: none;
    border-radius: var(--op-radius-md);
}
.op-frontend .op-exp-head::-webkit-details-marker { display: none; }
/* The fold mark: an L turned down when open, toward the reading end when shut. */
.op-frontend .op-exp-head::before {
    content: '';
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    margin-inline-end: 4px;
    border-right: 2px solid var(--op-text-muted);
    border-bottom: 2px solid var(--op-text-muted);
    transform: rotate(-45deg);
    transition: transform .15s ease;
}
[dir="rtl"] .op-frontend .op-exp-head::before { transform: rotate(135deg); }
.op-frontend .op-exp-kind[open] > .op-exp-head::before { transform: rotate(45deg); }
.op-frontend .op-exp-head:hover { background: var(--op-bg-alt, var(--op-bg)); }
.op-frontend .op-exp-head:focus-visible { outline: 2px solid var(--op-primary); outline-offset: 1px; }
.op-frontend .op-exp-name { font-size: 15px; font-weight: 700; color: var(--op-text); }
.op-frontend .op-exp-tag {
    font-size: 12px;
    color: var(--op-text-muted);
    padding: 1px 8px;
    border-radius: var(--op-radius-pill);
    background: var(--op-bg-alt, var(--op-bg));
}
/* What the kind holds, so a shut kind still says it. */
.op-frontend .op-exp-pick {
    margin-inline-start: auto;
    font-size: 13px;
    font-weight: 700;
    color: var(--op-primary-dark);
}
.op-frontend .op-exp-pick:empty { display: none; }
.op-frontend .op-exp-body { padding: 0 var(--op-sp-3) var(--op-sp-3); min-width: 0; }
.op-frontend .op-exp-body > .op-field { margin-bottom: 0; }
.op-frontend .op-exp-body .op-addopt { margin-top: var(--op-sp-2); }
.op-frontend .op-exp .op-exp-run { margin-top: 0; }
/* After review: the expander's own two questions (Planned expansion, Kept in),
   in a panel that names the expander, set apart from Slow above and Dental below. */
.op-frontend .op-exp .op-exp-run {
    margin-bottom: var(--op-sp-2);
    padding: var(--op-sp-3);
    border: 1px solid var(--op-border);
    border-inline-start: 3px solid var(--op-primary);
    border-radius: var(--op-radius-md);
    background: var(--op-bg-alt, var(--op-bg));
}
.op-frontend .op-exp-run-for {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px var(--op-sp-2);
    margin: 0;
    font-size: 13px;
    color: var(--op-text-muted);
}
.op-frontend .op-exp-run-for bdi { font-size: 14px; font-weight: 700; color: var(--op-text); }
.op-frontend .op-exp-run-for bdi:empty { display: none; }

/* ---------- pln-space: distalisation, each arch its own (R11-PLN-12) ----------
   Upper under the Upper tile, Lower under the Lower tile — side by side from
   tablet width, the lower one under the upper on a phone. */
.op-frontend .op-distal-arches {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--op-sp-3);
    margin-top: var(--op-sp-2);
}
@media (min-width: 768px) {
    .op-frontend .op-distal-arches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .op-frontend .op-distal-set-upper { grid-column: 1; }
    .op-frontend .op-distal-set-lower { grid-column: 2; }
}
.op-frontend .op-distal-set {
    min-width: 0;
    padding: var(--op-sp-3);
    border: 1px solid var(--op-border);
    border-radius: var(--op-radius-md);
    background: var(--op-surface);
}
.op-frontend .op-distal-set[hidden] { display: none; }
.op-frontend .op-distal-title {
    margin: 0 0 var(--op-sp-2);
    font-size: 14px;
    font-weight: 700;
    color: var(--op-text);
}
.op-frontend .op-distal-set .op-field:last-child { margin-bottom: 0; }
.op-frontend .op-distal-set > .op-reveal:not([hidden]) { margin-bottom: var(--op-sp-2); }
.op-frontend .op-sp-detail > .op-distal-arches { margin-top: 0; }
/* After review: a 3.1.0 distalisation saved with no arch says what it holds, where he looks. */
.op-frontend .op-field-hint.op-distal-loose {
    margin: 0 0 var(--op-sp-2);
    padding: var(--op-sp-2) var(--op-sp-3);
    border-inline-start: 3px solid var(--op-warning, #b45309);
    border-radius: var(--op-radius-md);
    background: var(--op-warning-bg, #fff7ed);
    color: var(--op-warning-text, #7c2d12);
    font-size: 13px;
}
.op-frontend .op-field-hint.op-distal-loose[hidden] { display: none; }

/* ---------- pln-space: rotation on the quick picker (R11-PLN-09) ----------
   A thumb's target on a touch screen. */
@media (hover: none) and (pointer: coarse), (max-width: 640px) {
    /* fix/ceph24 (M24-13): the picker is smaller everywhere: 36 px, as on Diagnosis. */
    .op-frontend .op-rotation-block .op-tpick-chip { min-height: 36px; }
    .op-frontend .op-rotation-block .op-tpick-whole { min-height: 36px; }
}

/* ---------- pln-space: Special appliances, a section of its own (R11-PLN-14) ----------
   The '+' on the line of the chips; its form takes the whole line when open. */
.op-frontend .op-special-line {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--op-sp-2);
}
.op-frontend .op-special-line > .op-field { margin-bottom: 0; min-width: 0; }
.op-frontend .op-special-line > .op-addopt { margin: 0; }
.op-frontend .op-special-line > .op-addopt:has(.op-addopt-body:not([hidden])) { flex-basis: 100%; }
.op-frontend .op-fsec-special .op-chip { min-height: 40px; font-size: 14px; }
@media (hover: none) and (pointer: coarse), (max-width: 640px) {
    .op-frontend .op-fsec-special .op-chip,
    .op-frontend .op-special-line .op-addopt-open { min-height: 44px; }
}
/* ---------- end pln-space ---------- */

/* ---------- What a lab makes (R-PLN-18) ---------- */
.op-frontend .op-plan-lab {
    margin-top: var(--op-sp-4);
    padding-top: var(--op-sp-3);
    border-top: 1px solid var(--op-border);
}
.op-frontend .op-plan-lab-list {
    margin: 0 0 var(--op-sp-2);
    padding-inline-start: var(--op-sp-5);
}

/* ---------- fix/plan — how the expansion is run (R-PLN-12, our proposal) ----------
   The activation, the planned mm and the months it stays in, under the arch:
   one step down from the appliance, like the braces questions. */
.op-frontend .op-exp-run { display: grid; gap: var(--op-sp-2); min-width: 0; }
.op-frontend .op-exp-run .op-field { margin-bottom: 0; }
/* ---------- end fix/plan ---------- */

/* ---------- fix/pln-line (11 Nov 2026) ----------
   The 1st phase in two groups, Removable then Fixed functional (R11-PLN-15),
   each with its chips, then his three pluses one under another (R11-PLN-16):
   a note per chosen appliance, the phase's own note (in the group in use),
   the group's '+'. The Digital appliance chips take the same notes. */
.op-frontend .op-phase-hint { margin: 0 0 var(--op-sp-2); }
.op-frontend .op-phase-group + .op-phase-group {
    margin-top: var(--op-sp-3);
    padding-top: var(--op-sp-3);
    border-top: 1px dashed var(--op-border-strong);
}
.op-frontend .op-phase-group > .op-field-chips { margin-bottom: var(--op-sp-1); }
.op-frontend .op-appnotes { display: flex; flex-direction: column; }
.op-frontend .op-appnotes:empty { display: none; }
.op-frontend .op-appnote .op-note-fold,
.op-frontend .op-phase-note .op-note-fold,
.op-frontend .op-phase-notes-2 .op-note-fold { margin-bottom: 0; }
.op-frontend :is(.op-appnote, .op-phase-note) .op-field { margin-bottom: var(--op-sp-2); }
.op-frontend .op-phase-notes-2 { margin-top: var(--op-sp-3); }
.op-frontend .op-phase-notes-2 .op-field { margin-bottom: 0; }
/* The links stack under one another; on a touch screen each is a whole
   finger tall and none reaches into the next. */
@media (pointer: coarse) {
    .op-frontend [data-section="treatment"] :is(.op-appnote, .op-phase-note, .op-phase-notes-2) .op-note-fold-toggle {
        min-height: 44px;
        padding-block: 0;
        margin-block: 0;
    }
    /* …and so is each '+' on the plan, on a row of its own: the touch area
       the calm layer lends a text link (13px over and under) would reach
       into the note link above it. */
    .op-frontend [data-section="treatment"] .op-addopt > .op-addopt-open {
        min-height: 44px;
        padding-block: 0;
        margin-block: 0;
    }
}

/* A field the save is waiting on (R11-PLN-19): its name and its chips in the
   danger ink, the reason under it. */
.op-frontend .op-field-chips.is-invalid > .op-field-label { color: var(--op-danger-text); }
.op-frontend .op-field-chips.is-invalid .op-chip:not(.is-active) { border-color: var(--op-danger) !important; }
.op-frontend .op-field-error {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--op-danger-text);
}

