/* What the four modern looks share (Calm Clinic, Night Shift, Patient Record, Paper File): the mockup's shared
   section (designs.css, ".app …", nazeernajjar.com/mockups/clinic-modern/) put on the app's own markup and
   drawn in the tokens every look sets on :root[data-look="<id>"] (look-<id>.css):
     --bg --sf --ink --mut --line --ac --acs --on-ac --red   the page, a surface, the words, the quiet words,
                                                              the lines, the accent, its pale wash, the words on
                                                              the accent, and red;
     --font --radius                                          the look's type (its stack ends Tahoma, Arial,
                                                              sans-serif) and the corners of its boxes;
     --list-visits … --list-pathology                         each list's colour (its dot).
   Here: the page, the boxes with their labels above them, the buttons, the notes and messages, the strip, the
   download screen, the save marks, the dialogs, the card's own pieces, the shared pieces of shell.js (the
   brand, the side panel with Find, the patient's header, the tabs as tiles with their counts, the bar), the
   lists as cards (and as a table where the window is wide), Settings as cards of rows, the sign-in panels and
   the scanner; and on the phone, every control 44 × 44 and the bar fixed at the foot. Where each piece goes on
   the page is the look's own (look-<id>.css). Every selector starts with :root[data-modern], so nothing here
   can match in Classic (clinic.css), which this file never changes. Font sizes are a size times --ts, and a
   box or bar holding text has a min-height. The figures stay Latin; يحتاج مراجعة stays yellow with black words.
   Chromium 108 and Safari 15.4: no nesting, :has(), subgrid, text-wrap or color-mix(); icons drawn here are
   -webkit-mask pictures (data: URLs, which the pages' img-src allows) in the words' own colour.

   A long text box's whole value (long.js): its <textarea class="long-box"> in span.long takes the box's
   place, and grows with its text. The span's ::after holds the same text, hidden, in the same grid cell, so
   both must lay their text out alike: a look sets the font on .long (the box takes it through font:
   inherit) and changes the padding, the border's width or the line height through --long-pad, --long-edge
   and --long-line only. */

:root[data-modern] {
  --shell-bar-h: calc(60px * var(--ts));
  --focus: var(--ac, #000000);
  /* The icons, as masks. */
  --i-search: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E");
  --i-visits: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  --i-settings: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h8M16 7h4M4 17h4M12 17h8'/%3E%3Ccircle cx='14' cy='7' r='2'/%3E%3Ccircle cx='10' cy='17' r='2'/%3E%3C/svg%3E");
  --i-check: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5L20 7'/%3E%3C/svg%3E");
  --i-plus: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  --i-back: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 6 6 6-6 6'/%3E%3C/svg%3E");
  --i-fwd: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 6-6 6 6 6'/%3E%3C/svg%3E");
  --i-stop: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v9'/%3E%3Cpath d='M6.3 7.3a8 8 0 1 0 11.4 0'/%3E%3C/svg%3E");
  --i-qr: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7'/%3E%3Crect x='14' y='3' width='7' height='7'/%3E%3Crect x='3' y='14' width='7' height='7'/%3E%3Cpath d='M14 14h3v3h-3zM20 14h1M14 20h3M20 18v3'/%3E%3C/svg%3E");
  --i-exit: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 4H5v16h5M14 8l4 4-4 4M8 12h10'/%3E%3C/svg%3E");
  --i-wifi: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 9a14 14 0 0 1 20 0M5.5 12.5a9 9 0 0 1 13 0M9 16a4 4 0 0 1 6 0M12 19h.01'/%3E%3C/svg%3E");
  --i-undo: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m15 4 5 5-5 5'/%3E%3Cpath d='M20 9H9a5 5 0 0 0 0 10h4'/%3E%3C/svg%3E");
  --i-shield: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3 4 6v6c0 5 3.5 8 8 9 4.5-1 8-4 8-9V6z'/%3E%3C/svg%3E");
  --i-chat: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E");
  --i-monitor: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='12' rx='2'/%3E%3Cpath d='M8 20h8M12 16v4'/%3E%3C/svg%3E");
  --i-eye: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  --i-cloud: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 18a4 4 0 0 1-.5-8 6 6 0 0 1 11.5 1.5A3.5 3.5 0 0 1 17.5 18z'/%3E%3C/svg%3E");
  --i-lock: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
  --i-palette: 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.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3a9 9 0 0 0 0 18c1.5 0 2-1 2-2s-1-1.5-1-2.5 1-1.5 2-1.5h2a4 4 0 0 0 4-4c0-4.4-4-8-9-8z'/%3E%3Ccircle cx='7.5' cy='11' r='1'/%3E%3Ccircle cx='10' cy='7' r='1'/%3E%3Ccircle cx='15' cy='7.5' r='1'/%3E%3C/svg%3E");
}

/* An icon drawn by a ::before or ::after: a mask in the words' colour. Each use sets --icon. */
:root[data-modern] .btn-icon::before,
:root[data-modern] #to-visits::before,
:root[data-modern] #new-card::before,
:root[data-modern] .tool::before,
:root[data-modern] .btn-scan::before,
:root[data-modern] .strip::after,
:root[data-modern] .set-title::before,
:root[data-modern] .row-new-title::before {
  content: '';
  display: inline-block;
  flex: 0 0 auto;
  width: calc(16px + 6px * var(--ts));
  height: calc(16px + 6px * var(--ts));
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

:root[data-modern] #save { --icon: var(--i-check); }
:root[data-modern] #undo { --icon: var(--i-undo); }
:root[data-modern] #to-visits { --icon: var(--i-visits); }
:root[data-modern] #new-card { --icon: var(--i-plus); }
:root[data-modern] #stop { --icon: var(--i-stop); }
:root[data-modern] #find { --icon: var(--i-search); }
:root[data-modern] #exit { --icon: var(--i-exit); }
:root[data-modern] .btn-scan { --icon: var(--i-qr); }

/* The card's icon buttons (✓, ↶, STOP, the binoculars, the exit) as an icon with their words: Access's own
   pictures give way to the look's icon, and the words are the button's own name (aria-label). */
:root[data-modern] .btn-icon svg,
:root[data-modern] .tool svg {
  display: none;
}

:root[data-modern] .btn-icon::after,
:root[data-modern] .tool::after {
  content: attr(aria-label);
  min-width: 0;
}

:root[data-modern] .btn-icon,
:root[data-modern] .tool {
  width: auto;
  min-width: 44px;
  min-height: 44px;
  padding: 6px 14px;
}

/* The record bar's arrows, in the words' colour. */
:root[data-modern] .rec-btn svg path,
:root[data-modern] .rec-btn svg rect {
  fill: currentColor;
}

:root[data-modern] .rec-btn svg path[stroke] {
  stroke: currentColor;
}

/* The page. */
:root[data-modern] body {
  background: var(--bg, #FFFFFF);
  color: var(--ink, #000000);
  font-family: var(--font, Tahoma, Arial, sans-serif);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:root[data-modern] h1,
:root[data-modern] h2,
:root[data-modern] h3 {
  font-weight: 600;
  line-height: 1.3;
}

/* A title band: the look's bar at the top of a page. */
:root[data-modern] .band {
  background: var(--sf, #FFFFFF);
  border-bottom: 1px solid var(--line, #808080);
  box-shadow: none;
}

:root[data-modern] .band h1 {
  font-size: calc(17px * var(--ts));
  font-weight: 600;
}

/* The boxes, each with its label above it. */
:root[data-modern][data-text][data-look] .label,
:root[data-modern][data-text][data-look] .cell-label,
:root[data-modern][data-text][data-look] .lf-on .cell-label {
  display: block;
  min-height: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--mut, #404040);
  font-size: calc(13px * var(--ts));
  font-weight: 500;
  line-height: 1.4;
}

:root[data-modern] .field {
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  margin: 0 0 14px;
}

:root[data-modern] .field .label {
  justify-self: stretch;
}

:root[data-modern] .box,
:root[data-modern] .field input,
:root[data-modern] .card .box,
:root[data-modern] .list .box,
:root[data-modern] .side-q {
  min-height: 48px;
  padding: 6px 14px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--line, #808080);
  border-radius: var(--radius, 0);
  box-shadow: none;
  color: var(--ink, #000000);
  font-size: calc(16px * var(--ts));
  line-height: 1.45;
}

:root[data-modern] .card .box-name {
  min-height: 48px;
  background: var(--sf, #FFFFFF);
  border-color: var(--line, #808080);
  box-shadow: none;
  font-size: calc(16px * var(--ts));
}

:root[data-modern] .box-select {
  -webkit-appearance: none;
  appearance: none;
  padding-inline-end: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2378858F' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 14px center;
  background-size: 20px 20px;
}

:root[data-modern] .box:focus,
:root[data-modern] .field input:focus,
:root[data-modern] .card .box:focus,
:root[data-modern] .list .box:focus,
:root[data-modern] .long > .long-box:focus,
:root[data-modern] .side-q:focus,
:root[data-modern] .rec-pos:focus {
  border-color: var(--ac, #000000);
  outline: 2px solid var(--ac, #000000);
  outline-offset: 1px;
}

:root[data-modern] button:focus-visible,
:root[data-modern] a:focus-visible,
:root[data-modern] .check:focus-visible {
  outline: 2px solid var(--ac, #000000);
  outline-offset: 2px;
}

:root[data-modern] .box::placeholder,
:root[data-modern] .side-q::placeholder {
  color: var(--mut, #404040);
  opacity: 0.8;
}

/* A yes or no (التدخين): a switch. */
:root[data-modern] .check {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: 46px;
  height: 28px;
  margin: 10px 0;
  border: 0;
  border-radius: 14px;
  background: var(--line, #808080);
  cursor: pointer;
  transition: background-color 0.15s;
}

:root[data-modern] .check::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: right 0.15s;
}

:root[data-modern] .check:checked {
  background: var(--ac, #000000);
}

:root[data-modern] .check:checked::before {
  right: 21px;
}

/* The buttons: a quiet surface with a line round it; the main one in the accent. */
:root[data-modern] .btn {
  gap: 8px;
  min-height: 44px;
  padding: 6px 16px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--line, #808080);
  border-radius: var(--radius, 0);
  box-shadow: none;
  color: var(--ink, #000000);
  font-size: calc(16px * var(--ts));
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
}

:root[data-modern] .btn:active {
  box-shadow: none;
  transform: none;
  filter: brightness(0.96);
}

:root[data-modern] .btn[disabled] {
  color: var(--mut, #404040);
  opacity: 0.6;
}

:root[data-modern] .btn-main {
  background: var(--ac, #000000);
  border-color: var(--ac, #000000);
  color: var(--on-ac, #FFFFFF);
  font-size: calc(16px * var(--ts));
}

:root[data-modern] .btn-main[disabled] {
  color: var(--on-ac, #FFFFFF);
}

:root[data-modern] .link {
  min-height: 44px;
  color: var(--ac, #000000);
  font-weight: 500;
  text-underline-offset: 3px;
}

:root[data-modern] .actions {
  gap: 10px;
}

/* Notes, messages, warnings. */
:root[data-modern] .note,
:root[data-modern] .dialog-note,
:root[data-modern] .review-what {
  color: var(--mut, #404040);
  font-weight: 400;
}

:root[data-modern] .msg {
  padding: 10px 14px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--red, #CC0000);
  border-radius: var(--radius, 0);
  box-shadow: none;
  color: var(--red, #CC0000);
  font-weight: 600;
}

:root[data-modern] .warn,
:root[data-modern] .f-warn {
  padding: 8px 12px;
  background: #FFF4D6;
  border: 0;
  border-radius: var(--radius, 0);
  color: #5A4300;
  font-weight: 600;
}

:root[data-modern] .notice {
  gap: 10px;
  padding: 6px 16px;
  background: #FFF4D6;
  border-bottom: 1px solid var(--line, #808080);
  color: #5A4300;
  font-weight: 600;
}

:root[data-modern] .notice-close {
  min-width: 44px;
  min-height: 44px;
  background: none;
  border: 0;
  border-radius: var(--radius, 0);
  color: #5A4300;
}

/* The offline strip: red, its words white and moving, a wifi mark at its start. */
:root[data-modern] .strip {
  height: calc(36px * var(--ts));
  background: var(--red, #CC0000);
  color: #FFFFFF;
  font-size: calc(14px * var(--ts));
  font-weight: 600;
  line-height: calc(36px * var(--ts));
}

:root[data-modern] .strip::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  width: calc(44px * var(--ts));
  background: var(--red, #CC0000);
}

:root[data-modern] .strip::after {
  --icon: var(--i-wifi);
  position: absolute;
  top: 50%;
  right: 12px;
  z-index: 2;
  width: calc(20px * var(--ts));
  height: calc(20px * var(--ts));
  margin-top: calc(-10px * var(--ts));
}

:root[data-modern].strip-on body {
  padding-top: calc(36px * var(--ts));
}

/* The download screen. */
:root[data-modern] .download {
  background: var(--bg, #FFFFFF);
}

:root[data-modern] .download-box {
  padding: 28px 24px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--line, #808080);
  border-radius: calc(var(--radius, 0) + 8px);
  box-shadow: 0 8px 30px rgba(19, 35, 46, 0.08);
}

:root[data-modern] .download-text {
  font-size: calc(17px * var(--ts));
  font-weight: 600;
}

:root[data-modern] .download-bar,
:root[data-modern] .bar {
  height: 10px;
  background: var(--acs, #E0E0E0);
  border: 0;
  border-radius: 5px;
}

:root[data-modern] .download-fill,
:root[data-modern] .bar-fill {
  background: var(--ac, #000000);
  border-radius: 5px;
}

/* Where a save is: محفوظ على الجهاز in the quiet colour, محفوظ in the accent, unsaved typing in amber. */
:root[data-modern] .save-mark,
:root[data-modern] .save-mark[data-save-mark="pending"] {
  color: var(--mut, #404040);
  font-size: calc(14px * var(--ts));
  font-weight: 600;
}

:root[data-modern] .save-mark[data-save-mark="sent"] {
  color: var(--ac, #000000);
}

:root[data-modern] .save-mark[data-unsaved-mark] {
  color: #8A5A00;
}

/* The dialogs: Find, a field to check, the phone app's update, the administrator's password. */
:root[data-modern] .dialog {
  padding: 0;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--line, #808080);
  border-radius: calc(var(--radius, 0) + 8px);
  box-shadow: 0 20px 60px rgba(19, 35, 46, 0.25);
  color: var(--ink, #000000);
}

:root[data-modern] .dialog::backdrop {
  background: rgba(19, 35, 46, 0.45);
}

:root[data-modern] .dialog-band {
  display: flex;
  align-items: center;
  min-height: calc(56px * var(--ts));
  padding: 8px 20px;
  background: var(--sf, #FFFFFF);
  border-bottom: 1px solid var(--line, #808080);
  font-size: calc(17px * var(--ts));
  font-weight: 600;
}

:root[data-modern] .dialog-body {
  padding: 16px 20px 20px;
}

:root[data-modern] .find-results {
  max-height: none;
  background: none;
  border: 0;
}

:root[data-modern] .find-hit {
  min-height: 56px;
  padding: 8px 14px;
  background: var(--sf, #FFFFFF);
  border: 0;
  border-bottom: 1px solid var(--line, #808080);
  border-radius: 0;
  color: var(--ink, #000000);
}

:root[data-modern] .find-hit:hover,
:root[data-modern] .find-hit:focus {
  background: var(--acs, #E0E0E0);
}

:root[data-modern] .find-name {
  font-weight: 600;
}

:root[data-modern] .find-card {
  color: var(--mut, #404040);
  font-variant-numeric: tabular-nums;
}

:root[data-modern] .review-option {
  padding: 12px 14px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--line, #808080);
  border-radius: var(--radius, 0);
  box-shadow: none;
}

:root[data-modern] .review-item .review-option {
  box-shadow: none;
}

:root[data-modern] .review-value {
  font-weight: 600;
}

:root[data-modern] .review-meta,
:root[data-modern] .review-field-name {
  color: var(--mut, #404040);
}

/* The card's own pieces: why a value is refused, a box brought back from its draft, a field to check. */
:root[data-modern] .f-msg {
  padding: 6px 10px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--red, #CC0000);
  border-radius: var(--radius, 0);
  color: var(--red, #CC0000);
  font-weight: 600;
}

:root[data-modern] .f-unsaved {
  padding: 6px 10px;
  background: #FFE7D1;
  border: 0;
  border-radius: var(--radius, 0);
  color: #7A3B00;
}

:root[data-modern] .card [data-unsaved],
:root[data-modern] .list [data-unsaved] {
  outline: 2px dashed #B85C00;
  outline-offset: 1px;
}

:root[data-modern] .review-mark {
  min-height: 44px;
  padding: 4px 14px;
  border: 1px solid #000000;
  border-radius: var(--radius, 0);
  box-shadow: none;
}

/* Every control of the card is 44 × 44 at least, on any device. */
:root[data-modern] .rec-btn,
:root[data-modern] .rec-pos {
  min-width: 44px;
  min-height: 44px;
}

/* The shared pieces (shell.js): the base every look starts from. */
:root[data-modern] .shell-brand,
:root[data-modern] .shell-hero,
:root[data-modern] .shell-tabs,
:root[data-modern] .shell-toolbar,
:root[data-modern] .shell-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--sf, #FFFFFF);
  color: var(--ink, #000000);
}

:root[data-modern] .shell-side {
  display: block;
  padding: 8px 12px;
  background: var(--sf, #FFFFFF);
  color: var(--ink, #000000);
}

:root[data-modern] .shell button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--line, #808080);
  border-radius: var(--radius, 0);
  background: var(--sf, #FFFFFF);
  color: var(--ink, #000000);
  cursor: pointer;
}

:root[data-modern] .shell [aria-current="page"] {
  border-color: var(--ac, #000000);
  background: var(--acs, #E0E0E0);
  font-weight: bold;
}

:root[data-modern] .shell svg {
  flex: 0 0 auto;
}

:root[data-modern] .shell-name {
  font-weight: bold;
}

:root[data-modern] .shell-tagline,
:root[data-modern] .shell-date {
  color: var(--mut, #404040);
}

/* The patient's header: his initial in a round, his name, and his card number, age and sex as chips. */
:root[data-modern] .shell-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "avatar name" "avatar chips";
  align-items: center;
  column-gap: 12px;
  row-gap: 2px;
  background: none;
}

:root[data-modern] .hero-avatar {
  grid-area: avatar;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: calc(44px * var(--ts));
  min-height: calc(44px * var(--ts));
  border-radius: 50%;
  background: var(--acs, #E0E0E0);
  color: var(--ac, #000000);
  font-size: calc(20px * var(--ts));
  font-weight: 600;
  line-height: 1;
}

:root[data-modern] .hero-name {
  grid-area: name;
  min-width: 0;
  font-size: calc(18px * var(--ts));
  font-weight: 600;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

:root[data-modern] .hero-chips {
  grid-area: chips;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  color: var(--mut, #404040);
}

:root[data-modern] .hero-chips > span {
  padding: 0 8px;
  border-radius: 999px;
  background: var(--acs, #E0E0E0);
  color: var(--ac, #000000);
  font-size: calc(12px * var(--ts));
  line-height: 1.7;
  font-variant-numeric: tabular-nums;
}

:root[data-modern] .hero-chips > span[hidden] {
  display: none;
}

/* The tabs as tiles (جداول المريض): each list with its colour's dot, its name, its count and a chevron. */
:root[data-modern] .shell-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

:root[data-modern] .shell-tabs [data-kind="visits"] { --dot: var(--list-visits, #0E7C86); }
:root[data-modern] .shell-tabs [data-kind="surgery"] { --dot: var(--list-surgery, #D64545); }
:root[data-modern] .shell-tabs [data-kind="hearing"] { --dot: var(--list-hearing, #2A9DB0); }
:root[data-modern] .shell-tabs [data-kind="xray"] { --dot: var(--list-xray, #C99A00); }
:root[data-modern] .shell-tabs [data-kind="lab"] { --dot: var(--list-lab, #4A86D8); }
:root[data-modern] .shell-tabs [data-kind="pathology"] { --dot: var(--list-pathology, #7A4FA8); }

/* The side panel: Find in the copy, and the cards last opened. */
:root[data-modern] .side-label,
:root[data-modern] .side-title {
  display: block;
  margin: 8px 0 4px;
  color: var(--mut, #404040);
  font-size: calc(13px * var(--ts));
  font-weight: 500;
}

:root[data-modern] .side-q {
  display: block;
  width: 100%;
  min-height: 52px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235C6B78' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.6-3.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 20px 20px;
  border-radius: calc(var(--radius, 0) + 2px);
}

/* The Find boxes, the side panel's and the Find dialog's: the magnifier is always at the right (a look that
   draws none on the dialog's box sets its own padding), but each box is dir="auto", so while empty or holding
   a card number it runs left to right. Their room is therefore set by side, not by the writing's start: 44 px
   on the magnifier's side, 14 on the other, whatever is typed. Empty, a box runs right to left, so its hint
   starts at the magnifier; and its clear button (×) is gone while it is empty, where Chrome would otherwise
   keep its room at the hint's end and cut the hint. */
:root[data-modern] .side-q,
:root[data-modern] #find-q {
  padding-right: 44px;
  padding-left: 14px;
}

:root[data-modern] .side-q:placeholder-shown,
:root[data-modern] #find-q:placeholder-shown {
  direction: rtl;
}

:root[data-modern] .side-q:placeholder-shown::-webkit-search-cancel-button,
:root[data-modern] #find-q:placeholder-shown::-webkit-search-cancel-button {
  display: none;
}

/* Its hint, a little smaller than what is typed, so it fits the box at the larger sizes too. */
:root[data-modern] .side-q::placeholder {
  font-size: 0.8em;
}

:root[data-modern] .side-note {
  margin: 6px 0;
  color: var(--mut, #404040);
  font-size: calc(13px * var(--ts));
}

:root[data-modern] .side-note:empty {
  display: none;
}

:root[data-modern] .side-results,
:root[data-modern] .side-recent {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

:root[data-modern] .shell .find-hit {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--radius, 0);
  background: none;
  text-align: right;
}

:root[data-modern] .shell .find-hit:hover,
:root[data-modern] .shell .find-hit:focus {
  background: var(--acs, #E0E0E0);
}

/* An administrator's device (body.no-shell, from look-early.js before the first paint and from shell.js):
   no piece shows, as their hidden attribute will have it once shell.js has run. */
:root[data-modern] .no-shell .shell {
  display: none !important;
}

/* A long text box's whole value. */
:root[data-modern] .long-src {
  display: none !important;
}

:root[data-modern] .long {
  display: grid;
  min-width: 0;
}

:root[data-modern] .long > .long-box,
:root[data-modern] .long::after {
  grid-area: 1 / 1 / 2 / 2;
  min-width: 0;
  margin: 0;
  padding: var(--long-pad, 6px 10px);
  border: var(--long-edge, 1px) solid transparent;
  font: inherit;
  letter-spacing: inherit;
  line-height: var(--long-line, 1.45);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
}

:root[data-modern] .long::after {
  content: attr(data-text) ' ';
  visibility: hidden;
  pointer-events: none;
}

:root[data-modern] .long > .long-box {
  display: block;
  width: 100%;
  min-height: 44px;
  overflow: hidden;
  resize: none;
  border-color: var(--line, #808080);
  border-radius: var(--radius, 0);
  background: var(--sf, #FFFFFF);
  color: var(--ink, #000000);
}

:root[data-modern] .long > .long-box[aria-invalid="true"] {
  border-color: var(--red, #CC0000);
}

/* The lists (form 2 to 7). Each record is a card of boxes with their labels (the new one, dashed, first);
   where a look's window is wide enough, a white table with its header on the page's colour. */
:root[data-modern] .list-page {
  background: var(--bg, #FFFFFF);
}

:root[data-modern] .kind-visits .list-title,
:root[data-modern] .kind-hearing .list-title {
  color: var(--ink, #000000);
  text-shadow: none;
}

:root[data-modern] .list-name {
  color: var(--ink, #000000);
  font-size: calc(17px * var(--ts));
}

:root[data-modern] .band .list-title {
  font-size: calc(17px * var(--ts));
}

:root[data-modern] .kind-visits .list-back {
  color: var(--ink, #000000);
}

:root[data-modern][data-text][data-look] .list-head {
  display: none;
}

:root[data-modern][data-text][data-look] .head-cell,
:root[data-modern][data-text][data-look] .kind-visits .head-cell {
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--mut, #404040);
  font-size: calc(13px * var(--ts));
  font-weight: 600;
  text-align: right;
}

:root[data-modern][data-text][data-look] .list-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 0;
}

:root[data-modern][data-text][data-look] .row,
:root[data-modern][data-text][data-look] .kind-visits .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px 14px;
  padding: 14px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--line, #808080);
  border-radius: calc(var(--radius, 0) + 2px);
  box-shadow: none;
}

:root[data-modern][data-text][data-look] .row-new {
  order: -1;
  border-style: dashed;
}

:root[data-modern][data-text][data-look] .row-new-title {
  --icon: var(--i-plus);
  display: flex;
  align-items: center;
  gap: 6px;
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  color: var(--ac, #000000);
  font-weight: 600;
}

:root[data-modern][data-text][data-look] .cell,
:root[data-modern][data-text][data-look] .cell + .cell {
  display: grid;
  gap: 10px 14px;
  min-width: 0;
  margin: 0;
}

:root[data-modern][data-text][data-look] .lf,
:root[data-modern][data-text][data-look] .lf-on,
:root[data-modern][data-text][data-look] .lf + .lf {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  min-width: 0;
  margin: 0;
}

:root[data-modern][data-text][data-look] .lf-on .box-date {
  color: var(--ac, #000000);
  font-weight: 600;
}

:root[data-modern][data-text][data-look] .list .box-tall {
  min-height: 48px;
}

:root[data-modern][data-text][data-look] .kind-visits [data-column="الملاحظات"] .box,
:root[data-modern][data-text][data-look] .kind-visits .box-fee {
  background: var(--sf, #FFFFFF);
  text-align: right;
}

:root[data-modern][data-text][data-look] .row-mark,
:root[data-modern][data-text][data-look] .row-mark.save-mark {
  display: inline-block;
  justify-self: start;
  align-self: center;
  margin: 0;
  padding: 2px 10px;
  background: var(--acs, #E0E0E0);
  border: 0;
  border-radius: 999px;
  color: var(--ac, #000000);
  font-size: calc(12px * var(--ts));
  font-weight: 600;
}

:root[data-modern][data-text][data-look] .row-mark:empty {
  display: none;
}

:root[data-modern][data-text][data-look] .row-mark.save-mark[data-save-mark="pending"] {
  background: #FFF4D6;
  color: #5A4300;
}

:root[data-modern][data-text][data-look] .row-mark.save-mark[data-save-mark="sent"] {
  background: var(--acs, #E0E0E0);
  color: var(--ac, #000000);
}

:root[data-modern][data-text][data-look] .row-mark.save-mark[data-unsaved-mark] {
  background: #FFE7D1;
  color: #7A3B00;
}

:root[data-modern][data-text][data-look] .list-note {
  color: var(--mut, #404040);
}

/* Settings: each section a card of rows under its quiet title. */
:root[data-modern] .set {
  margin: 0 0 22px;
}

:root[data-modern] .set-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  background: none;
  box-shadow: none;
  color: var(--mut, #404040);
  font-size: calc(15px * var(--ts));
  font-weight: 600;
}

:root[data-modern] #appearance .set-title { --icon: var(--i-palette); }
:root[data-modern] #about .set-title { --icon: var(--i-shield); }
:root[data-modern] #channel .set-title { --icon: var(--i-chat); }
:root[data-modern] #devices .set-title { --icon: var(--i-monitor); }
:root[data-modern] #reviews .set-title { --icon: var(--i-eye); }
:root[data-modern] #backups .set-title { --icon: var(--i-cloud); }
:root[data-modern] #admin .set-title { --icon: var(--i-lock); }

:root[data-modern] .set-body {
  padding: 8px 16px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--line, #808080);
  border-radius: calc(var(--radius, 0) + 2px);
  box-shadow: none;
}

:root[data-modern] .set-notice {
  border: 0;
  border-radius: var(--radius, 0);
  box-shadow: none;
}

:root[data-modern] .set-part + .set-part,
:root[data-modern] .set-content + .set-part {
  border-top-color: var(--line, #808080);
}

:root[data-modern] .set-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  min-height: 52px;
  margin: 0;
}

:root[data-modern] .set-key {
  font-weight: 400;
}

:root[data-modern] .version {
  font-size: calc(16px * var(--ts));
  font-weight: 600;
}

:root[data-modern] .set-note,
:root[data-modern] .set-small,
:root[data-modern] .app-offered,
:root[data-modern] .device-seen,
:root[data-modern] .look-note {
  color: var(--mut, #404040);
  font-weight: 400;
}

:root[data-modern] .set-said {
  margin: 10px 0;
  color: var(--ac, #000000);
  font-weight: 600;
}

:root[data-modern] .set-sub {
  font-size: calc(15px * var(--ts));
}

:root[data-modern] .app-row,
:root[data-modern] .device,
:root[data-modern] .review-item {
  min-height: 52px;
  border-top: 1px solid var(--line, #808080);
  border-bottom: 0;
}

:root[data-modern] .device:first-child,
:root[data-modern] .review-item:first-child {
  border-top: 0;
}

:root[data-modern] .app-name,
:root[data-modern] .device-name {
  font-weight: 500;
}

:root[data-modern] .app-get,
:root[data-modern] .device-signout,
:root[data-modern] .table .btn,
:root[data-modern] .backup-download {
  min-height: 44px;
  padding: 4px 14px;
  background: var(--acs, #E0E0E0);
  border-color: var(--acs, #E0E0E0);
  color: var(--ac, #000000);
  font-size: calc(15px * var(--ts));
}

:root[data-modern] .app-other {
  color: var(--ac, #000000);
}

:root[data-modern] #signout-others {
  width: 100%;
  background: var(--sf, #FFFFFF);
  border-color: var(--red, #CC0000);
  color: var(--red, #CC0000);
}

:root[data-modern] .device-user,
:root[data-modern] .device-here {
  padding: 0 8px;
  background: var(--acs, #E0E0E0);
  border-radius: 999px;
  box-shadow: none;
  color: var(--ac, #000000);
  font-size: calc(12px * var(--ts));
  font-weight: 600;
}

:root[data-modern] .set-legend {
  margin: 8px 0 4px;
  font-weight: 500;
}

:root[data-modern] .choice,
:root[data-modern] .look-choice,
:root[data-modern] .text-choice {
  min-height: 48px;
  padding: 2px 4px;
  border-radius: var(--radius, 0);
}

:root[data-modern] .choice input,
:root[data-modern] .look-choice input,
:root[data-modern] .text-choice input {
  accent-color: var(--ac, #000000);
}

:root[data-modern] .table {
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

:root[data-modern] .table th,
:root[data-modern] .table td {
  padding: 8px 6px;
  border: 0;
  border-top: 1px solid var(--line, #808080);
  font-weight: 400;
}

:root[data-modern] .table thead th {
  background: none;
  border-top: 0;
  color: var(--mut, #404040);
  font-weight: 600;
}

:root[data-modern] .counts-fewer td {
  color: var(--red, #CC0000);
}

/* The sign-in page: the form, and on the PC the QR, each on a panel. */
:root[data-modern][data-text][data-look] .login-panel,
:root[data-modern] .qr-panel {
  padding: 24px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--line, #808080);
  border-radius: calc(var(--radius, 0) + 8px);
  box-shadow: 0 8px 30px rgba(19, 35, 46, 0.06);
}

:root[data-modern] .qr-panel h2 {
  padding: 0;
  background: none;
  border: 0;
  font-size: calc(17px * var(--ts));
}

:root[data-modern] .qr-panel p {
  padding: 0;
  color: var(--mut, #404040);
}

:root[data-modern] .login-form .actions .btn-main {
  flex: 1 1 100%;
  min-height: 52px;
  font-size: calc(17px * var(--ts));
}

:root[data-modern] #code {
  min-height: 56px;
  font-size: calc(24px * var(--ts));
  font-weight: 600;
  letter-spacing: 0.3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

:root[data-modern] .btn-resend,
:root[data-modern] .login-form [data-back] {
  background: none;
  border-color: transparent;
  color: var(--ac, #000000);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

:root[data-modern] .btn-resend[disabled] {
  color: var(--mut, #404040);
  opacity: 1;
  text-decoration: none;
}

:root[data-modern] .resent {
  color: var(--ac, #000000);
}

/* The scanner. */
:root[data-modern] .scan-frame {
  border: 0;
  border-radius: calc(var(--radius, 0) + 8px);
  box-shadow: none;
}

:root[data-modern] .scan-aim {
  border-radius: var(--radius, 0);
}

:root[data-modern] .scan-panel {
  padding: 20px;
  background: var(--sf, #FFFFFF);
  border: 1px solid var(--line, #808080);
  border-radius: calc(var(--radius, 0) + 2px);
  box-shadow: none;
}

:root[data-modern] .scan-title {
  font-size: calc(18px * var(--ts));
  font-weight: 600;
}

:root[data-modern] .scan-pc {
  font-size: calc(17px * var(--ts));
  font-weight: 600;
}

:root[data-modern] .scan-when {
  color: var(--mut, #404040);
}

:root[data-modern] .scan-words {
  font-size: calc(16px * var(--ts));
  font-weight: 500;
}

/* The phone, upright or on its side. */
@media (max-width: 699.98px), (hover: none) and (pointer: coarse) and (max-height: 699.98px) {
  :root[data-modern] .shell-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 800;
    flex-wrap: nowrap;
    gap: 0;
    height: var(--shell-bar-h);
    padding: 0;
    border-top: 1px solid var(--line, #808080);
  }

  :root[data-modern] .shell-bar button {
    flex: 1 1 0;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    height: 100%;
    padding: 4px;
    border: 0;
    border-radius: 0;
    font-size: calc(12px * var(--ts));
  }

  :root[data-modern] .card-page,
  :root[data-modern] .list-page,
  :root[data-modern] .settings-page {
    padding-bottom: var(--shell-bar-h);
  }

  /* An administrator's Settings has no bar, so no room is kept for it (each look gives its own foot). */
  :root[data-modern] .settings-page.no-shell {
    padding-bottom: 0;
  }

  /* The record bar in the page, under the bottom bar as it scrolls by: Classic's z-index (800, the bottom
     bar's own) would still lift it over the bar wherever the page lays it out as a flex or grid item. */
  :root[data-modern] .recbar {
    position: static;
    z-index: auto;
  }

  :root[data-modern] button,
  :root[data-modern] a.btn {
    min-width: 44px;
    min-height: 44px;
  }

  :root[data-modern] select,
  :root[data-modern] textarea,
  :root[data-modern] input:not([type="checkbox"]):not([type="radio"]) {
    min-height: 44px;
  }

  :root[data-modern] .rec-btn {
    width: 44px;
    height: 44px;
  }
}
