/* OrthoPlan Pro — Clinic & Patient (package CLI, 6 Nov 2026).
 *
 * Layout only, on the existing containers and tokens; the look is package
 * S's design layer. Logical properties throughout: every page is also
 * rendered right to left. */

/* ---------- My signature, three ways (R-CLI-01) ----------
 *
 * The faces a typed signature is set in, shipped with the plugin
 * (public/assets/fonts, SIL Open Font Licence, the licences beside them).
 * Not fetched from a font service: a typed signature is SAVED as a picture,
 * so the face it was drawn in is the one on every report from then on — it
 * must not depend on whether a clinic's network let a font through that
 * day. Declared here, downloaded only when Type is chosen (op-clinic.js asks
 * for them); a page that never types a name never loads them. */
@font-face {
    font-family: "OrthoPlan Ruqaa";
    font-style: normal;
    font-weight: 700;
    font-display: block;
    src: url("../fonts/aref-ruqaa-700-arabic.woff2") format("woff2");
    unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
    font-family: "OrthoPlan Ruqaa";
    font-style: normal;
    font-weight: 700;
    font-display: block;
    src: url("../fonts/aref-ruqaa-700-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF;
}
@font-face {
    font-family: "OrthoPlan Script";
    font-style: normal;
    font-weight: 600;
    font-display: block;
    src: url("../fonts/dancing-script-600-latin.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+FEFF;
}

.op-frontend .op-mysig-modes { margin-block-end: var(--op-sp-3); }
.op-frontend .op-mysig-way {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: var(--op-sp-2) var(--op-sp-3);
    max-width: 560px;
    margin-block-end: var(--op-sp-3);
}
.op-frontend .op-mysig-way[data-sigmode-panel="type"] { flex-direction: column; align-items: stretch; }
/* display: flex above would otherwise beat the hidden attribute. */
.op-frontend .op-mysig-way[hidden],
.op-frontend .op-mysig [data-sigpad-clear][hidden] { display: none; }
/* A picture or a typed name is not drawn over: the pad only shows it. */
.op-frontend .op-mysig[data-sigmode="upload"] .op-sigpad-canvas,
.op-frontend .op-mysig[data-sigmode="type"] .op-sigpad-canvas { pointer-events: none; cursor: default; }

/* ---------- Patient information: City and Address in the grid (R-CLI-03/04) ---------- */
/* The combobox is a .op-field among plain labels; it lines up with them. */
.op-frontend #op-info-form > .op-field { margin-block-end: 0; }
.op-frontend #op-info-form > .op-field > .op-field-label { font-size: 13px; font-weight: 600; }

/* ---------- Medical history: the conditions need the whole row (R-CLI-06) ---------- */
.op-frontend .op-history-grid > .op-history-card.is-yes[data-history-conditions] { grid-column: 1 / -1; }
.op-frontend .op-history-card[data-history-conditions] .op-field-chips { margin-block-end: var(--op-sp-2); }
.op-frontend .op-history-card[data-history-conditions] .op-addopt { margin-block-end: var(--op-sp-2); }

/* ---------- Sharing: private is red (R-CLI-08, R-SYS-11) ---------- */
.op-frontend .op-share-card.is-private { border-color: var(--op-danger); }
.op-frontend .op-plan-badge.op-plan-private { background: var(--op-danger-bg); color: var(--op-danger-text); }
/*
 * The button's red text has to be readable (WCAG AA, 4.5:1): the registry's
 * red, #d64545, is 4.4:1 on white. Inside this card the button reads the
 * registry's deeper red for --op-danger, so its text, outline and hover fill
 * are all that one, and white on it is 8:1. The bar and the border stay the
 * registry's red.
 */
.op-frontend .op-share-card.is-private .op-share-toggle { --op-danger: var(--op-danger-text); }

/* ---------- fix/misc (R11-CLI-01): a started case's Sharing card explains, it does not offer ---------- */
/* The sentence reads as text, not as the red badge above it; its two links are the footer's doors. */
.op-frontend .op-share-card .op-share-fixed { margin: var(--op-sp-2) 0 0; color: var(--op-text-muted); line-height: 1.6; }
.op-frontend .op-share-card .op-share-fixed .op-share-open { vertical-align: baseline; }
.op-ds .op-share-card .op-share-fixed { color: var(--ds-ink-2); font: 400 var(--ds-fs-md)/var(--ds-lh-md) var(--ds-font); }
/* A started case that is shared is not "private": nothing red about it. */
.op-ds .op-share-card.is-fixed:not(.is-private) .op-share-state { color: var(--ds-ink-2); }
/* fix/misc (R11-SYS-01): the Consult us dialog's "the case stays open to you" line sits close under the first. */
.op-frontend .op-consult-still-yours { margin-top: calc(-1 * var(--op-sp-1)); }

/* ======================================================================
 * fix/clinic18 (17 Nov 2026 call, C17-CLI-01): Settings › Doctors at your
 * clinics; the case's treating doctor; the associate doctor's own screen.
 * Existing tokens only. Logical properties: every page is also RTL.
 * ====================================================================== */
.op-frontend .op-cdoc-clinic { padding-top: var(--op-sp-3); margin-top: var(--op-sp-3); border-top: 1px solid var(--op-border); scroll-margin-top: 96px; }
.op-frontend .op-cdoc-clinic:first-of-type { border-top: 0; margin-top: 0; }
.op-frontend .op-cdoc-clinic.is-target { border-inline-start: 3px solid var(--op-primary); padding-inline-start: var(--op-sp-3); }
.op-frontend .op-cdoc-clinic-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px var(--op-sp-2); margin: 0 0 var(--op-sp-2); font-size: 15px; }
.op-frontend .op-cdoc-clinic-name .op-muted { font-size: 12.5px; font-weight: 500; }
.op-frontend .op-cdoc-list { list-style: none; margin: 0 0 var(--op-sp-2); padding: 0; display: flex; flex-direction: column; }
.op-frontend .op-cdoc-row {
    display: flex; flex-wrap: wrap; align-items: center; gap: var(--op-sp-2) var(--op-sp-4);
    padding: 10px 0; border-bottom: 1px solid var(--op-border);
}
.op-frontend .op-cdoc-row:last-child { border-bottom: 0; }
/* flex-start, not stretch: a Latin name (dir="auto") in an Arabic page stays at the page's start edge. */
.op-frontend .op-cdoc-who { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; flex: 1 1 200px; }
/* The label beside its box reads as words, not as a section's label bar. */
.op-ds .op-cdoc-pct .op-field-label::before { content: none; }
.op-frontend .op-cdoc-who .op-muted { font-size: 12.5px; overflow-wrap: anywhere; }
.op-frontend .op-cdoc-pct { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--op-sp-2); margin: 0; }
.op-frontend .op-cdoc-pct .op-field-label { margin: 0; }
.op-frontend .op-cdoc-pct .op-input-wrap { width: 96px; }
.op-frontend .op-cdoc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.op-frontend .op-cdoc-add > summary { display: inline-flex; align-items: center; list-style: none; cursor: pointer; }
.op-frontend .op-cdoc-add > summary::-webkit-details-marker { display: none; }
.op-frontend .op-cdoc-form {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--op-sp-3);
    margin-top: var(--op-sp-3); padding: var(--op-sp-3) var(--op-sp-4);
    border: 1px solid var(--op-border); border-radius: var(--op-radius-md); background: var(--op-bg-alt);
}
.op-frontend .op-cdoc-form .op-cdoc-span { grid-column: 1 / -1; }
.op-frontend .op-cdoc-form [hidden] { display: none !important; }
.op-frontend .op-cdoc-form .op-input-wrap { max-width: 140px; }
.op-frontend .op-cdoc-secret { margin-top: var(--op-sp-3); }

/* The case's treating doctor, beside its clinic. */
.op-frontend .op-treating-field[hidden] { display: none !important; }
.op-frontend .op-treating-field .op-field-hint { display: block; margin-top: 4px; font-weight: 400; }
.op-frontend .op-treating-tag { font-weight: 600; }

/* The card on Settings, set apart from the currency card above it. */
.op-frontend .op-cdoc-card { margin-top: var(--op-sp-4); }

/* The associate doctor's screen: one card per clinic he was given. */
.op-frontend.op-associate .op-page-head p { max-width: 70ch; }
.op-frontend .op-associate-clinic { margin-bottom: var(--op-sp-4); }
.op-frontend .op-associate-table td, .op-frontend .op-associate-table th { white-space: nowrap; }

@media (max-width: 640px) {
    .op-frontend .op-cdoc-form { grid-template-columns: minmax(0, 1fr); padding: var(--op-sp-3); }
    .op-frontend .op-cdoc-row { align-items: stretch; }
    .op-frontend .op-cdoc-pct, .op-frontend .op-cdoc-actions { width: 100%; }
    .op-frontend .op-table-cards.op-associate-table td { white-space: normal; }
}

@media (pointer: coarse) {
    .op-frontend .op-cdoc-add > summary,
    .op-frontend .op-cdoc-row .op-btn,
    .op-frontend .op-cdoc-form .op-btn,
    .op-frontend .op-cdoc-pct .op-input,
    .op-frontend .op-cdoc-form .op-input,
    .op-frontend .op-treating-field select,
    .op-frontend .op-clinic-doctors-link { min-height: 44px; }
}
