/* Specialty records (السجلات التخصصية): the odontogram and treatment plans,
   growth charts, vaccines and milestones, pregnancy and fertility follow-up.
   Flat: solid fills and hairlines from the app's tokens, so dark mode and the
   clinic colour follow. Logical properties only. Charts are LTR SVG. */

/* ------------------------------------------------------------- shared */

.specialty-head h1 .av {
  flex: none;
}
.specialty-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.specialty-chips {
  margin: 0 0 14px;
}
.card-actions .specialty-chips {
  margin: 0;
}
.specialty-chips a {
  padding: 4px 12px;
  font-size: 0.82rem;
}
.specialty-chips a.is-off,
.specialty-bands a.is-future {
  opacity: 0.6;
}
.specialty-cell-note {
  display: block;
  font-size: 0.76rem;
  line-height: 1.5;
}
.specialty-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
}
.specialty-from-plan {
  margin-inline-start: 6px;
  font-size: 0.7rem;
  padding: 0 7px;
}
.specialty-plan-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: -6px 0 16px;
}
.specialty-progress {
  margin: 6px 0 2px;
  max-width: 300px;
  height: 6px;
}
.specialty-chart-wrap svg,
.specialty-odo-wrap svg,
.specialty-mini svg,
.specialty-mini-chart svg,
.specialty-print-chart svg {
  display: block;
  width: 100%;
  height: auto;
}
.specialty-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0 10px;
}
.specialty-inline-form {
  margin-block-start: 14px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--line);
}
.specialty-tone {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  white-space: nowrap;
}
.tone-ok {
  color: var(--ok);
}
.tone-warn {
  color: var(--warn);
}
.tone-danger {
  color: var(--danger);
}
.tone-info {
  color: var(--info);
}
.specialty-tone.tone-ok {
  background: var(--ok-soft);
}
.specialty-tone.tone-warn {
  background: var(--warn-soft);
}
.specialty-tone.tone-danger {
  background: var(--danger-soft);
}
.specialty-tone.tone-info {
  background: var(--info-soft);
}
.specialty-stat-text {
  font-size: 1.05rem !important;
  line-height: 1.4 !important;
}
.specialty-give {
  display: inline-block;
}
.specialty-give[open] {
  flex-basis: 100%;
}
.specialty-give > summary {
  list-style: none;
}
.specialty-give > summary::-webkit-details-marker {
  display: none;
}
.specialty-give form {
  margin-block-start: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.specialty-give .field {
  margin-block-end: 8px;
}

/* ------------------------------------------------------- the odontogram */

/* Phones: chart, then the editor, then plans and notes. Desktop: the editor
   beside the chart, plans and notes under the chart. */
.specialty-dental {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.specialty-dental-main {
  display: contents;
}
.specialty-chart-card {
  order: 1;
}
.specialty-editor-card {
  order: 2;
}
.specialty-dental-lower {
  order: 3;
}
@media (min-width: 1100px) {
  .specialty-dental {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  .specialty-dental-main {
    display: block;
    order: 1;
  }
  .specialty-dental-main .specialty-dental-lower {
    margin-block-start: 18px;
  }
  .specialty-editor-card {
    position: sticky;
    inset-block-start: calc(var(--top-h) + 12px);
  }
}
.specialty-dental .card {
  margin: 0;
}
.specialty-nowrap {
  white-space: nowrap;
}
.specialty-odo-narrow {
  display: none !important;
}
@media (max-width: 760px) {
  .specialty-odo-wide {
    display: none !important;
  }
  .specialty-odo-narrow {
    display: block !important;
  }
}
.specialty-odo {
  user-select: none;
  -webkit-user-select: none;
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}
.specialty-odo a {
  outline: none;
}
.specialty-tooth {
  cursor: pointer;
}
.specialty-tsel {
  fill: transparent;
}
.specialty-tooth:hover .specialty-tsel,
.specialty-odo a:focus-visible .specialty-tsel {
  fill: var(--surface-2);
  stroke: var(--line-strong);
}
.specialty-tooth.is-sel .specialty-tsel {
  fill: var(--brand-soft);
  stroke: var(--brand);
  stroke-width: 1.5;
}
.specialty-tnum {
  font-size: 11px;
  font-weight: 600;
  fill: var(--ink-2);
}
.specialty-tooth.is-sel .specialty-tnum {
  fill: var(--brand-ink);
}
.specialty-sf {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1;
}
.specialty-sf.c-caries {
  fill: var(--danger);
}
.specialty-sf.c-filling {
  fill: var(--info);
}
.specialty-sf.c-fill-amalgam {
  fill: var(--ink-2);
}
.specialty-sf.c-fill-gic {
  fill: var(--info-soft);
  stroke: var(--info);
}
.specialty-sf.c-fill-temp {
  fill: var(--warn-soft);
  stroke: var(--warn);
}
.specialty-sf.c-sealant {
  fill: var(--ok);
}
.specialty-root {
  fill: var(--surface-2);
  stroke: var(--line-strong);
}
.specialty-root.is-rct {
  fill: var(--violet);
  stroke: var(--violet);
}
.specialty-implant {
  fill: var(--ok-soft);
  stroke: var(--ok);
}
.specialty-implant-th {
  stroke: var(--ok);
  stroke-width: 1.2;
}
.specialty-crown {
  fill: none;
  stroke: var(--warn);
  stroke-width: 3;
}
.specialty-crown.is-temp {
  stroke-dasharray: 3 2;
}
.specialty-veneer {
  fill: none;
  stroke: var(--violet);
  stroke-width: 3;
  stroke-linecap: round;
}
.specialty-bridge {
  fill: var(--warn-soft);
  stroke: var(--warn);
  stroke-width: 1;
}
.specialty-fracture {
  fill: none;
  stroke: var(--danger);
  stroke-width: 2;
  stroke-linejoin: round;
}
.specialty-x {
  stroke-width: 2.6;
  stroke-linecap: round;
}
.specialty-x.is-missing {
  stroke: var(--muted);
}
.specialty-x.is-extract {
  stroke: var(--danger);
}
.specialty-tooth.is-missing .specialty-sf {
  fill: transparent;
  stroke-dasharray: 2 2;
}
.specialty-tooth.is-impacted .specialty-sf,
.specialty-tooth.is-impacted .specialty-root {
  stroke-dasharray: 3 2;
  opacity: 0.75;
}
.specialty-mob {
  font-size: 10px;
  font-weight: 700;
  fill: var(--danger);
}
.specialty-plan-dot {
  fill: var(--info);
}
.specialty-note-dot {
  fill: var(--warn);
}
.specialty-midline,
.specialty-arch {
  stroke: var(--line-strong);
  stroke-dasharray: 4 3;
}
.specialty-side,
.specialty-rowlabel {
  font-size: 11px;
  fill: var(--muted);
}
.specialty-odo.is-mini .specialty-tsel,
.specialty-odo.is-mini .specialty-tooth {
  cursor: default;
}
.specialty-legend {
  margin-block-start: 10px;
}
.specialty-sw {
  width: 12px !important;
  height: 12px !important;
  border-radius: 3px !important;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.specialty-sw.c-caries {
  background: var(--danger);
  border-color: var(--danger);
}
.specialty-sw.c-filling {
  background: var(--info);
  border-color: var(--info);
}
.specialty-sw.c-fill-amalgam {
  background: var(--ink-2);
  border-color: var(--ink-2);
}
.specialty-sw.c-sealant {
  background: var(--ok);
  border-color: var(--ok);
}
.specialty-sw.is-crown {
  border: 3px solid var(--warn);
  border-radius: 50% !important;
}
.specialty-sw.is-rct {
  background: var(--violet);
  border-color: var(--violet);
}
.specialty-sw.is-implant {
  background: var(--ok-soft);
  border-color: var(--ok);
}
.specialty-sw.is-bridge {
  background: var(--warn-soft);
  border-color: var(--warn);
}
.specialty-sw.is-extract {
  border: 2px solid var(--danger);
}
.specialty-sw.is-missing {
  border-style: dashed;
  border-color: var(--muted);
}
.specialty-sw.is-plan {
  background: var(--info);
  border-color: var(--info);
  border-radius: 50% !important;
}
.specialty-hint {
  margin: 8px 0 0;
}

/* the tooth editor */
.specialty-sel-desc {
  font-weight: 600;
  margin-block-end: 10px;
}
.specialty-editor fieldset {
  padding: 8px 12px 4px;
}
.specialty-editor .field {
  margin-block-end: 10px;
}
.specialty-surfaces {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block: 4px 8px;
}
.specialty-surface {
  position: relative;
  cursor: pointer;
}
.specialty-surface input {
  position: absolute;
  opacity: 0;
  inset: 0;
  margin: 0;
}
.specialty-surface span {
  display: inline-grid;
  place-items: center;
  min-width: 46px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.specialty-surface input:checked + span {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.specialty-surface input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.specialty-act.c-caries {
  color: var(--danger);
  border-color: var(--danger);
}
.specialty-act.c-filling {
  color: var(--info);
  border-color: var(--info);
}
.specialty-act.c-sealant {
  color: var(--ok);
  border-color: var(--ok);
}
.specialty-act-group {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.specialty-act-group select {
  width: auto;
  min-height: 34px !important;
  padding: 2px 8px !important;
  font-size: 0.84rem;
}
.specialty-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block-end: 10px;
}
.specialty-flag[aria-pressed='true'] {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.specialty-editor-row {
  gap: 0 10px;
}
.specialty-tooth-history ol {
  max-height: 240px;
  overflow-y: auto;
  margin-block-start: 10px;
}
.specialty-dental + .card {
  margin-block-start: 18px;
}

/* plans */
.specialty-plans li > div {
  flex: 1;
}
.specialty-newplan {
  margin-block-start: 14px;
  padding-block-start: 14px;
  border-block-start: 1px solid var(--line);
}
.specialty-items .specialty-phase-row td,
.specialty-estimate .specialty-phase-row td {
  background: var(--surface-2);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.specialty-alt-row td {
  color: var(--ink-2);
  font-size: 0.9rem;
}
.specialty-alt-row td:first-child {
  padding-inline-start: 28px;
}
.specialty-row-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
.specialty-items td:last-child {
  min-width: 150px;
}
.specialty-money {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.specialty-inst td,
.specialty-inst th,
.specialty-assess td {
  white-space: nowrap;
}
.specialty-assess td:first-child {
  white-space: normal;
}
.specialty-inst tr[data-inst='overdue'] td {
  color: var(--danger);
}
.specialty-item-form .specialty-surfaces {
  margin-block-end: 0;
}

/* ------------------------------------------------------------- growth */

.specialty-growth {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (min-width: 1100px) {
  .specialty-growth {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
}
.specialty-growth > .card,
.specialty-side > .card {
  margin-block-end: 18px;
}
.specialty-ind-tabs {
  margin-block-end: 12px;
}
.specialty-chart {
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
}
.specialty-plot {
  fill: var(--surface);
  stroke: var(--line-strong);
}
.specialty-grid {
  stroke: var(--line);
  stroke-width: 0.7;
}
.specialty-grid.is-major {
  stroke: var(--line-strong);
}
.specialty-axis {
  font-size: 10px;
  fill: var(--muted);
}
.specialty-axis-title {
  font-size: 11px;
  fill: var(--ink-2);
}
.specialty-band {
  fill: var(--brand-soft);
}
.specialty-chart-m .specialty-band {
  fill: var(--info-soft);
}
.specialty-chart-f .specialty-band {
  fill: var(--violet-soft);
}
.specialty-pc {
  fill: none;
  stroke: var(--brand);
  stroke-width: 1.2;
}
.specialty-chart-m .specialty-pc {
  stroke: var(--info);
}
.specialty-chart-f .specialty-pc {
  stroke: var(--violet);
}
.specialty-pc.is-median {
  stroke-width: 2.2;
}
.specialty-pc.is-outer {
  stroke-dasharray: 5 3;
}
.specialty-pc-label {
  font-size: 10px;
  font-weight: 600;
  fill: var(--muted);
}
.specialty-child-line {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
}
.specialty-child-pt {
  fill: var(--surface);
  stroke: var(--ink);
  stroke-width: 2;
}
.specialty-child-pt:hover {
  fill: var(--ink);
}
.specialty-chart.is-small .specialty-child-line {
  stroke-width: 1.5;
}
.specialty-pct {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.specialty-pct.tone-warn {
  color: var(--warn);
}
.specialty-pct.tone-danger {
  color: var(--danger);
}
.specialty-pct.tone-info {
  color: var(--info);
}
.specialty-assess td {
  padding: 7px 6px;
}
.specialty-measures td {
  vertical-align: top;
}
.specialty-vitals {
  margin-block-end: 6px;
}

/* milestones */
.specialty-ms {
  padding: 6px 14px 2px;
}
.specialty-ms-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  padding: 9px 0;
  border-block-end: 1px solid var(--line);
}
.specialty-ms-row:last-child {
  border-block-end: 0;
}
.specialty-ms-row > span:first-child {
  flex: 1 1 260px;
}
.specialty-ms-row small {
  display: block;
  font-size: 0.75rem;
  text-align: start;
}
.specialty-ms-row.is-no {
  border-inline-start: 3px solid var(--warn);
  padding-inline-start: 10px;
}
.specialty-ms-row.is-yes > span:first-child {
  color: var(--ink-2);
}
.specialty-ms-pick {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}
.specialty-ms-pick label {
  position: relative;
  cursor: pointer;
}
.specialty-ms-pick input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
}
.specialty-ms-pick span {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.8rem;
  background: var(--surface);
}
.specialty-ms-pick input:focus-visible + span {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
.specialty-ms-pick input[value='yes']:checked + span {
  background: var(--ok);
  border-color: var(--ok);
  color: var(--surface);
}
.specialty-ms-pick input[value='no']:checked + span {
  background: var(--warn);
  border-color: var(--warn);
  color: var(--surface);
}
.specialty-ms-pick input[value='']:checked + span {
  background: var(--surface-2);
  color: var(--muted);
}

/* vaccines */
.specialty-vax-group h3 {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin: 16px 0 2px;
  font-size: 0.92rem;
  color: var(--ink-2);
}
.specialty-vax-group:first-child h3 {
  margin-block-start: 0;
}
.specialty-vax-row {
  padding-inline-start: 10px;
  border-inline-start: 3px solid transparent;
}
.specialty-vax-row.is-overdue {
  border-inline-start-color: var(--danger);
}
.specialty-vax-row.is-due {
  border-inline-start-color: var(--warn);
}
.specialty-vax-row.is-soon {
  border-inline-start-color: var(--info);
}
.specialty-vax-row.is-given strong {
  color: var(--ink-2);
}
.specialty-next-vax {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-block-start: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.9rem;
}
.specialty-next-vax > span {
  flex: 1;
  min-width: 180px;
}
.specialty-next-vax > .ic {
  color: var(--brand);
}

/* ---------------------------------------------------------- pregnancy */

.specialty-preg-hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-block-end: 16px;
}
.specialty-preg-hero > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.specialty-preg-hero > div:first-child {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.specialty-preg-hero strong {
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}
.specialty-preg-hero span:last-child {
  font-size: 0.82rem;
  opacity: 0.85;
}
.specialty-hero-label {
  font-size: 0.8rem;
  opacity: 0.85;
}
.specialty-preg-hero .specialty-hero-ga {
  font-size: 2.4rem;
  line-height: 1.1;
}
.specialty-preg {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (min-width: 1100px) {
  .specialty-preg {
    grid-template-columns: minmax(0, 1fr) 360px;
  }
}
.specialty-preg-side > .card,
.specialty-preg-main > .card {
  margin-block-end: 18px;
}
.specialty-charts {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr));
  margin-block-end: 18px;
}
.specialty-charts > .card {
  margin: 0;
}
.specialty-anc td,
.specialty-anc th,
.specialty-follicles td {
  white-space: nowrap;
}
.specialty-anc td.small {
  white-space: normal;
  min-width: 120px;
}
.specialty-gpal {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 8px;
}
.specialty-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0 10px;
}
.specialty-checks .check {
  margin-block: 4px;
  font-size: 0.9rem;
}
.specialty-tri > summary {
  cursor: pointer;
  font-weight: 700;
  padding: 8px 0;
  color: var(--ink-2);
}
.specialty-checklist li {
  padding-inline-start: 10px;
  border-inline-start: 3px solid transparent;
}
.specialty-checklist li.is-overdue {
  border-inline-start-color: var(--danger);
}
.specialty-checklist li.is-due {
  border-inline-start-color: var(--warn);
}
.specialty-checklist li.is-na {
  opacity: 0.55;
}
.specialty-checklist li.is-done > span:first-child {
  color: var(--ink-2);
}
.specialty-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
}
.specialty-dot {
  stroke: var(--surface);
  stroke-width: 1.5;
}
.s-sys {
  stroke: var(--danger);
}
.specialty-dot.s-sys {
  fill: var(--danger);
}
.s-dia {
  stroke: var(--info);
}
.specialty-dot.s-dia {
  fill: var(--info);
}
.s-wt {
  stroke: var(--brand);
}
.specialty-dot.s-wt {
  fill: var(--brand);
}
.s-fh {
  stroke: var(--violet);
}
.specialty-dot.s-fh {
  fill: var(--violet);
}
.s-right {
  stroke: var(--info);
}
.specialty-dot.s-right {
  fill: var(--info);
}
.s-left {
  stroke: var(--violet);
}
.specialty-dot.s-left {
  fill: var(--violet);
}
.s-endo {
  stroke: var(--ok);
}
.specialty-dot.s-endo {
  fill: var(--ok);
}
.specialty-dot {
  stroke: var(--surface);
}
.specialty-ref {
  stroke: var(--warn);
  stroke-dasharray: 5 4;
}
.specialty-ref-label {
  font-size: 10px;
  fill: var(--warn);
}
.specialty-ga-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-block-end: 8px;
}
.specialty-ga-line > span {
  display: flex;
  flex-direction: column;
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.specialty-ga-line small {
  font-size: 0.72rem;
  color: var(--muted);
}
.specialty-ga-line strong {
  font-variant-numeric: tabular-nums;
}
.specialty-gyn-next {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--violet-soft);
  color: var(--ink);
}

/* ----------------------------------------- patient file and visit cards */

.specialty-mini {
  display: block;
  margin-block-end: 6px;
  border-radius: var(--radius-sm);
}
.specialty-mini-chart {
  display: block;
  margin-block: 6px;
}
.specialty-quick {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  margin-block-start: 10px;
  padding-block-start: 10px;
  border-block-start: 1px solid var(--line);
}
.specialty-quick-row {
  display: flex;
  gap: 6px;
  width: 100%;
}
.specialty-quick-row input {
  flex: 1;
  min-width: 0;
  min-height: 38px !important;
  padding: 4px 8px !important;
}
.specialty-todo li {
  flex-wrap: wrap;
}
.specialty-todo .specialty-quick-row {
  flex: 1 1 100%;
}
.specialty-todo .specialty-quick-row .btn {
  flex: none;
}
.specialty-todo li.is-done {
  opacity: 0.6;
}

/* ------------------------------------------------------------------ hub */

.specialty-hub-vax {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-block: 2px;
}
.specialty-search {
  flex: 1 1 280px;
  margin: 0;
}
.specialty-dash .list li a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.specialty-dash .list li strong {
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------- settings */

.specialty-records {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  margin-block-end: 16px;
}
.specialty-record strong {
  font-size: 0.95rem;
}
.specialty-prices input {
  max-width: 150px;
  min-height: 38px !important;
  padding-block: 4px !important;
}
.specialty-vrow,
.specialty-arow {
  display: grid;
  gap: 6px;
  align-items: center;
}
.specialty-vrow {
  grid-template-columns: minmax(170px, 2fr) minmax(90px, 1fr) 90px 66px 66px 76px 82px 70px 64px;
}
.specialty-arow {
  grid-template-columns: minmax(200px, 2.4fr) 100px 70px 70px 110px 70px minmax(110px, 1fr) 64px;
}
.specialty-vrow input,
.specialty-vrow select,
.specialty-arow input,
.specialty-arow select {
  min-height: 38px !important;
  padding: 4px 8px !important;
}
.specialty-vrow .check,
.specialty-arow .check {
  margin: 0;
  align-items: center;
  font-size: 0.85rem;
}
.specialty-vrow .check input,
.specialty-arow .check input {
  margin: 0;
}
.specialty-vrow-age {
  grid-column: 1 / -1;
  margin-block-start: -4px;
}
.specialty-del {
  justify-self: start;
  margin-block: -2px 6px;
}
@media (max-width: 900px) {
  .specialty-vrow,
  .specialty-arow {
    grid-template-columns: 1fr 1fr;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
  }
  .specialty-vrow > :first-child,
  .specialty-arow > :first-child {
    grid-column: 1 / -1;
  }
  .specialty-vrow.svc-head,
  .specialty-arow.svc-head {
    display: none;
  }
}

/* ---------------------------------------------------------------- phone */

@media (max-width: 600px) {
  .specialty-gpal {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .specialty-preg-hero .specialty-hero-ga {
    font-size: 2rem;
  }
  .specialty-items td:last-child {
    min-width: 0;
  }
  .specialty-quick-row {
    flex-wrap: wrap;
  }
  .specialty-quick-row input {
    flex: 1 1 40%;
  }
}

/* ------------------------------------------------------------- printing */

/* Printouts are paper: light colours whatever the screen's theme. */
.specialty-sheet,
.specialty-a5 {
  --surface: #ffffff;
  --surface-2: #f4f6f8;
  --line: #d9dee4;
  --line-strong: #b9c1cb;
  --ink: #111111;
  --ink-2: #333333;
  --muted: #666666;
  --ok: #047857;
  --ok-soft: #e1f4ec;
  --warn: #9a5b00;
  --warn-soft: #fff1d6;
  --danger: #b42318;
  --danger-soft: #fdeceb;
  --info: #1d4ed8;
  --info-soft: #e8effd;
  --violet: #6d28d9;
  --violet-soft: #efe8fc;
  --brand: var(--th-brand, #0a7c70);
  --brand-ink: var(--th-brand-ink, #08584f);
  --brand-soft: var(--th-brand-soft, #ddf2ee);
}
.specialty-sheet h3 {
  margin: 14px 0 6px;
  color: var(--brand);
}
.specialty-sheet .rx-clinic img,
.specialty-sheet .rx-clinic .logo-mark {
  max-width: 64px;
  max-height: 56px;
  width: auto;
  height: 48px;
}
.specialty-print-chart {
  margin-block: 4px 12px;
}
.specialty-sign {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  margin-block-start: 48px;
}
.specialty-sign div {
  padding-block-start: 6px;
  border-block-start: 1px solid #999;
  text-align: center;
  font-size: 0.85rem;
}
.specialty-card-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-block: 12px;
}
.specialty-card-facts > div {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
}
.specialty-card-facts small {
  color: #555;
  font-size: 0.75rem;
}
.specialty-card-facts strong {
  font-size: 1.05rem;
}
.specialty-print-checks {
  list-style: none;
  padding: 0;
  margin: 0;
  columns: 2;
  column-gap: 24px;
  font-size: 0.82rem;
}
.specialty-print-checks li {
  break-inside: avoid;
  margin-block-end: 4px;
}
.specialty-blank-row td {
  height: 26px;
}
.specialty-a5 {
  display: flex;
  flex-direction: column;
  width: 148mm;
  min-height: 210mm;
  margin: 16px auto;
  padding: 9mm 10mm;
  background: #fff;
  color: #111;
  border: 1px solid var(--line);
  page: specialty-a5;
}
.specialty-a5 .rx-top {
  border-block-end-color: var(--brand);
}
.specialty-card-table {
  width: 100%;
  margin-block: 6px;
  border-collapse: collapse;
  font-size: 9.5px;
  line-height: 1.35;
}
.specialty-card-table th,
.specialty-card-table td {
  padding: 2px 4px;
  border: 1px solid #bbb;
  text-align: start;
}
.specialty-card-table td.num {
  white-space: nowrap;
}
.specialty-card-table th {
  background: #f1f1f1;
}
.specialty-card-table tr.is-given td:nth-child(4) {
  font-weight: 700;
}
.specialty-a5 .rx-foot {
  margin-block-start: auto;
}
@page specialty-a5 {
  size: A5;
  margin: 0;
}
@media print {
  .specialty-a5 {
    width: auto;
    min-height: calc(210mm - 1px);
    margin: 0;
    border: 0;
  }
  .specialty-sheet table {
    page-break-inside: auto;
  }
  .specialty-sheet tr {
    break-inside: avoid;
  }
}

/* ------------------------------------------------------ periodontal chart */

.specialty-perio-stats {
  margin-block-end: 12px;
}
.specialty-perio-wrap {
  margin-block-end: 10px;
}
.specialty-perio th,
.specialty-perio td {
  padding: 4px 6px !important;
  text-align: center;
  min-width: 30px;
}
.specialty-perio th.is-missing {
  color: var(--muted);
  text-decoration: line-through;
}
.specialty-pd.is-4,
.specialty-sw.specialty-pd-4 {
  background: var(--warn-soft);
  color: var(--warn);
  font-weight: 700;
}
.specialty-pd.is-6,
.specialty-sw.specialty-pd-6 {
  background: var(--danger-soft);
  color: var(--danger);
  font-weight: 700;
}
.specialty-perio td.specialty-pd.is-bop {
  border-block-end: 3px solid var(--danger);
}
.specialty-sw.specialty-pd-bop {
  background: var(--surface);
  border-block-end: 3px solid var(--danger);
}
.specialty-perio-entry {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 520px;
  overflow-y: auto;
  padding-inline-end: 4px;
}
.specialty-perio-row {
  display: grid;
  grid-template-columns: 40px repeat(6, minmax(0, 1fr));
  gap: 4px;
  align-items: center;
}
.specialty-perio-head {
  position: sticky;
  inset-block-start: 0;
  background: var(--surface);
  font-size: 0.74rem;
  color: var(--muted);
  font-weight: 600;
  text-align: center;
  z-index: 1;
}
.specialty-perio-site {
  display: flex;
  align-items: center;
  gap: 2px;
}
.specialty-perio-site.is-l {
  border-inline-start: 2px solid var(--line-strong);
  padding-inline-start: 4px;
}
.specialty-perio-site input:not([type='checkbox']) {
  min-height: 34px !important;
  padding: 2px 4px !important;
  text-align: center;
}
.specialty-perio-site input[type='checkbox'] {
  width: 16px;
  height: 16px;
  accent-color: var(--danger);
}

/* chart legends */
.specialty-sw.s-sys {
  background: var(--danger);
  border-color: var(--danger);
}
.specialty-sw.s-dia,
.specialty-sw.s-right {
  background: var(--info);
  border-color: var(--info);
}
.specialty-sw.s-wt {
  background: var(--brand);
  border-color: var(--brand);
}
.specialty-sw.s-fh,
.specialty-sw.s-left {
  background: var(--violet);
  border-color: var(--violet);
}
.specialty-sw.s-endo {
  background: var(--ok);
  border-color: var(--ok);
}
.specialty-sw.s-ref {
  border: 0;
  border-block-start: 2px dashed var(--warn);
  border-radius: 0 !important;
  height: 0 !important;
}
.specialty-vax-later > summary {
  color: var(--ink-2);
}

/* Grids never grow past the screen because of a wide table inside: the table scrolls. */
.specialty-dental > *,
.specialty-growth > *,
.specialty-preg > *,
.specialty-charts > *,
.specialty-dental-main > * {
  min-width: 0;
}

/* Plan items on phones: one block per item (tooth, procedure and price, status, actions). */
@media (max-width: 700px) {
  .specialty-items,
  .specialty-items tbody {
    display: block;
  }
  .specialty-items thead {
    display: none;
  }
  .specialty-items tr {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    gap: 4px 10px;
    align-items: start;
    padding: 10px 12px;
    border-block-end: 1px solid var(--line);
  }
  .specialty-items td {
    display: block;
    padding: 0 !important;
    border: 0 !important;
    min-width: 0 !important;
  }
  .specialty-items td:nth-child(1) {
    grid-row: span 2;
  }
  .specialty-items td:nth-child(4) {
    grid-column: 2;
  }
  .specialty-items td:nth-child(5) {
    grid-column: 1 / -1;
  }
  .specialty-items tr.specialty-phase-row {
    display: block;
    padding: 0;
  }
  .specialty-items tr.specialty-phase-row td {
    padding: 8px 12px !important;
  }
  .specialty-items .specialty-row-actions {
    justify-content: flex-start;
  }
  .specialty-alt-row td:first-child {
    padding-inline-start: 0 !important;
  }
}
