/* Shared by the portals and the sign-in page until each has its own design. */
:root { color-scheme: light dark; --accent: #1f6feb; --muted: #6b7280; --bad: #b42318; --line: #d0d7de; }
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 -apple-system, system-ui, "Segoe UI", sans-serif; }
.pad { padding: 1rem; }
.om-page { min-height: 100vh; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 1rem; }
.om-card { width: 100%; max-width: 26rem; padding: 2rem; border: 1px solid var(--line); border-radius: 12px; }
.om-card h1 { font-size: 1.5rem; margin: 0 0 1rem; }
.om-card h2 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; }
.om-field { display: block; margin: .75rem 0; }
.om-field span { display: block; font-size: .9rem; margin-bottom: .25rem; }
.om-field input { width: 100%; padding: .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
button { font: inherit; cursor: pointer; }
.om-primary, .om-secondary, .om-choice { display: block; width: 100%; padding: .7rem; margin: .5rem 0; border-radius: 8px; }
.om-primary { background: var(--accent); color: white; border: 0; }
.om-secondary, .om-choice { background: transparent; border: 1px solid var(--line); }
.om-choice { text-align: left; }
.om-link { background: none; border: 0; color: var(--accent); padding: .25rem 0; }
.om-link:hover { color: var(--text); }
.om-muted {
    color: var(--muted);
    font-size: .9rem;
    /* padding: 0 15px; */
}
.om-notice { padding: .6rem .8rem; border-radius: 8px; background: rgba(31, 111, 235, .1); }
/* A warning that's a link to where it's fixed (the developer's rule: every warning banner is). */
.om-notice-link { display: block; width: 100%; border: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; margin: .5rem 0; }
.om-notice-link:hover { background: rgba(31, 111, 235, .18); }
.om-error { color: var(--bad); }
.om-divider { text-align: center; color: var(--muted); margin: 1.25rem 0 .25rem; }
.om-row { display: flex; justify-content: space-between; align-items: center; padding: .4rem 0; border-bottom: 1px solid var(--line); }
.om-agreement { max-height: 14rem; overflow: auto; white-space: pre-wrap; font-size: .85rem; padding: .75rem; border: 1px solid var(--line); border-radius: 8px; margin: .5rem 0 1rem; }
/* Fields side by side (login and password; server and port): no line between them. */
.om-fields { display: flex; gap: .75rem; }
.om-fields > .om-field, .om-fields > button { flex: 1; }
.om-fields > .om-field-narrow { flex: 0 0 7rem; }
/* Buttons in a row, without the list line `om-row` draws. */
.om-actions { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
/* The tenant portal's pages: room between sections, each starting at its heading with a line above. */
.om-form-page h2 { margin: 2.75rem 0 .75rem; font-size: 1.15rem; }
.om-form-page h1 + h2, .om-form-page h1 + p + h2 { border-top: 0; padding-top: 0; margin-top: 1.5rem; }
/* "-- OR --" between two ways of doing the same thing: one section, so no line. */
.om-form-page .om-or { text-align: center; color: var(--muted); margin: 2rem 0 0; letter-spacing: .08em; }
.om-form-page .om-or + h2 { border-top: 0; padding-top: 0; margin-top: 1.5rem; }
.om-form-page .om-field { margin: 1rem 0 1.25rem; }
.om-form-page .om-primary { margin-top: 1.25rem; }
.om-form-page > p { margin: .75rem 0; }
/* People: each person a block of their own. */
.om-member { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.om-member h3 { margin: 0 0 .15rem; font-size: 1rem; }
.om-member p { margin: 0 0 .5rem; }
.om-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.om-template-title { display: flex; align-items: center; gap: .5rem; }
.om-template-title h3 { margin: 0; }
.om-steps { list-style: none; padding: 0; margin: 1rem 0; }
.om-steps li { padding: .4rem 0; }
.om-steps .om-done { color: var(--muted); }
/* The tenant portal's open group: its checklist in the middle column, each item a heading with a mark. */
.om-split-group { grid-template-columns: minmax(18rem, 24rem) minmax(0, 1fr); }
.om-group-title { margin: 0 0 .25rem; font-size: 1.35rem; padding: 1.5rem 1rem; }
.om-checks { display: flex; flex-direction: column; gap: .15rem; margin-top: 1rem; }
.om-check { display: flex; align-items: center; gap: .8rem; width: 100%; padding: .6rem .7rem; text-align: left; font: inherit; color: var(--text); }
.om-check-button { border: 0; background: none; cursor: pointer; }
.om-check-button:hover { background: var(--surface); }
.om-check-active, .om-check-active:hover { background: var(--selected); }
.om-check-icon { width: 1.75rem; height: 1.75rem; flex: none; }
.om-check-text { display: flex; flex-direction: column; min-width: 0; }
.om-check-text h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.om-check-text .om-muted { font-size: .85rem; }
.om-logo { display: block; max-width: 240px; max-height: 120px; margin: .5rem 0; }
/* A group's portal sent them: the sign-in page wears its name and logo. */
.om-brand { border-bottom: 1px solid var(--line); margin-bottom: 1rem; padding-bottom: .5rem; }
.om-brand-name { font-weight: 600; font-size: 1.1rem; margin: 0; }

/* ===== The portals' frame (Docs/ui-design.md), after ElementaryUI's site. ===== */
:root {
  --bg: #f5f5f5; --surface: #f6f6f8; --raised: #ffffff; --text: #1d1d1f; --line: #e4e4e8; --muted: #6e6e76;
  --accent: #e8711c; --accent-soft: rgba(232, 113, 28, .12); --selected: rgba(232, 113, 28, .16);
  --topbar: 56px; --sidebar: 260px; --submitted: #3a3a3c;
}
/* The developer's dark theme: a warm brown page, borders in the selection's orange tint. Each
   person's choice is `data-theme` on <html> (their account's Appearance); without it, the computer's. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: color(display-p3 0.1384 0.1044 0.0767); --surface: #1c1c1f; --raised: #232327; --text: #e8e8ea;
    --line: var(--selected); --muted: #9b9ba3; --submitted: #d6d6da; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: color(display-p3 0.1384 0.1044 0.0767); --surface: #1c1c1f; --raised: #232327; --text: #e8e8ea;
  --line: var(--selected); --muted: #9b9ba3; --submitted: #d6d6da; color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }
body { background: var(--bg); color: var(--text); }
.om-app { display: grid; grid-template-rows: var(--topbar) 1fr; height: 100vh; }
.om-topbar { display: flex; align-items: center; gap: 1.5rem; padding: 0 1.25rem; border-bottom: 1px solid var(--line); }
.om-topbar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 1.05rem; }
.om-topbar-logo { height: 28px; max-width: 120px; object-fit: contain; display: block; }
.om-topbar-home { display: flex; align-items: center; }
.om-search-field { display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: .4rem .7rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); }
.om-kbd { font-size: .75rem; padding: .05rem .35rem; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.om-topbar-end { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.om-activity { color: var(--accent); }
.om-body { display: grid; grid-template-columns: auto 1fr; min-height: 0; }
.om-sidebar { border-right: 1px solid var(--line); padding: 1rem 1.75rem; overflow: auto; }
.om-side-heading { margin: 1rem .5rem .25rem; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.om-side-item { display: block; width: 100%; text-align: left; padding: .4rem .6rem; border: 0; border-radius: 6px; background: none; color: var(--text); }
.om-side-item:hover { background: var(--surface); }
.om-side-indent { padding-left: 1.5rem; color: var(--muted); }
.om-side-active, .om-side-active.om-side-indent { color: var(--accent); background: var(--accent-soft); }
.om-main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.om-content { flex: 1; min-height: 0; overflow: auto; padding: 1.5rem 2rem; }
.om-page-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
    /* padding: 1.5rem 1rem; */
}
.om-page-header h1 {
    margin: 0;
    font-size: 1.6rem;
}
.om-toolbar { display: flex; align-items: center; gap: .75rem; padding: .5rem 0 1rem; flex-wrap: wrap; }
.om-toolbar input { padding: .45rem .7rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; }
.om-pill { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line); background: none; color: var(--text); }
.om-pill-on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.om-button { padding: .45rem .9rem; border-radius: 8px; border: 1px solid var(--line); background: var(--raised); color: var(--text); }
.om-button-primary { background: var(--accent); border-color: var(--accent); color: white; }
.om-selection-bar { display: flex; align-items: center; gap: 1rem; padding: .5rem .75rem; margin-bottom: .5rem; border-radius: 8px; background: var(--accent-soft); }
/* Two panes: the list, and the open item beside it (Roundcube). */
.om-split { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); flex: 1; min-height: 0; }
.om-list-pane { overflow: auto; border-right: 1px solid var(--line); }
.om-detail-pane { overflow: auto; padding: 1.5rem 2rem; }
.om-table-row { display: grid; gap: .75rem; align-items: center; padding: .55rem .75rem; border-bottom: 1px solid var(--line);
  cursor: default; user-select: none; }
.om-table-row:hover { background: var(--surface); }
.om-table-head { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); position: sticky; top: 0; background: var(--bg); }
.om-table-head:hover { background: var(--bg); }
.om-table-row > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-selected, .om-selected:hover { background: var(--selected); }
.om-row-muted { color: var(--muted); }
.om-facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1.25rem; margin: 1rem 0; }
.om-facts dt { color: var(--muted); }
.om-facts dd { margin: 0; }
/* Every badge has the same shape (the border is always there, transparent unless a variant colors it),
   so badges side by side are the same size; the variants change colors only. */
.om-badge { display: inline-block; font-size: .75rem; line-height: 1.3; padding: .1rem .5rem; border-radius: 999px;
  border: 1px solid transparent; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.om-badge.om-badge-muted { background: var(--surface); color: var(--muted); border-color: var(--line); }
.om-empty { color: var(--muted); padding: 3rem 0; text-align: center; }
/* ⌘K */
.om-palette-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; z-index: 50; }
.om-palette { width: min(720px, 92vw); max-height: calc(100vh - 12vh - 2rem); display: flex; flex-direction: column; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; padding: .75rem; box-shadow: 0 20px 60px rgba(0, 0, 0, .35); }
.om-palette-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    margin-top: 0.5rem;
}
.om-palette input { width: 100%; padding: .7rem .9rem; font: inherit; font-size: 1.05rem; border: 1px solid var(--accent); border-radius: 8px; background: var(--bg); color: var(--text); }
/* Its own accent border shows it has the focus: no browser ring on top (the developer's call). */
.om-palette input:focus, .om-palette input:focus-visible { outline: none; box-shadow: none; }
.om-palette-item { display: flex; justify-content: space-between; width: 100%; padding: .55rem .8rem; margin-top: .25rem; border: 0; border-radius: 6px; background: none; color: var(--text); text-align: left; }
.om-palette-on { background: var(--accent-soft); }
.om-palette-empty { padding: .75rem .8rem; }
.om-palette-hints { margin: .75rem 0 0; color: var(--muted); font-size: .85rem; display: flex; gap: .35rem; align-items: center; }
/* Notification cards: `om-toasts-<edge>` places them. */
.om-toasts { position: fixed; z-index: 60; display: flex; flex-direction: column; gap: .5rem; width: min(380px, 92vw); padding: 1rem; pointer-events: none; }
.om-toasts-bottom-right { right: 0; bottom: 0; }
.om-toasts-bottom-left { left: 0; bottom: 0; }
.om-toasts-top-right { right: 0; top: var(--topbar); }
.om-toasts-top-left { left: 0; top: var(--topbar); }
.om-toasts-bottom { left: 50%; transform: translateX(-50%); bottom: 0; }
.om-toasts-top { left: 50%; transform: translateX(-50%); top: var(--topbar); }
.om-toast { pointer-events: auto; position: relative; padding: .75rem 2rem .75rem .9rem; border-radius: 10px; background: var(--raised);
  border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); }
.om-toast-success { border-left: 3px solid #2da44e; }
.om-toast-problem { border-left: 3px solid var(--bad); }
.om-toast-info { border-left: 3px solid var(--accent); }
.om-toast-close { position: absolute; top: .35rem; right: .5rem; border: 0; background: none; color: var(--muted); font-size: 1.1rem; }
.om-progress { height: 4px; margin-top: .5rem; border-radius: 2px; background: var(--line); overflow: hidden; }
.om-progress-bar { height: 100%; background: var(--accent); }
.om-case-detail { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.om-detail-pane h2 { font-size: 1.1rem; margin: 1.25rem 0 .5rem; }
/* The patient list's rows (the developer's design): a bar and status in the status's color. */
/* (--submitted is with the theme colors above, so the dark theme can change it.) */
:root { --draft: #e08a2c; --completed: #2da44e; --deleted: #cf222e; }
.om-list-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* margin-bottom: 1rem; */
    padding: 1.5rem 1rem;
    position: sticky;
    top: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
}
.om-list-actions h1 { margin: 0; font-size: 1.6rem; }
.om-list-note { padding: 0 1rem; margin: 1rem 0; }
.om-list-buttons { display: flex; gap: .5rem; }
/* As on the old dashboard (patientRow): a 3px column in the status's color, then the row; rows
   separated by a line, no background (a selected row is tinted, so the selection shows). */
.om-prow {
    display: grid;
    grid-template-columns: 3px 1fr auto;
    column-gap: 1rem;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--line);
    cursor: default;
    user-select: none;
}
.om-prow-bar { align-self: stretch; background: var(--status, var(--line)); }
.om-prow.om-selected, .om-crow.om-selected { background: var(--selected); }
/* A patient's cases, in the pane: the same bar, the case, its dates and people, its actions. */
.om-crow { display: grid; grid-template-columns: 3px 7rem 1fr auto auto; column-gap: 1rem; align-items: center;
  padding: 1rem; border-radius: 5px; border-bottom: 1px solid var(--line); cursor: default; user-select: none; }
.om-crow-case { display: flex; flex-direction: column; line-height: 1.35; }
.om-status-draft { --status: var(--draft); }
.om-status-submitted { --status: var(--submitted); }
.om-status-completed { --status: var(--completed); }
.om-status-deleted { --status: var(--deleted); }
.om-prow-case, .om-prow-names { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.om-prow-names > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.om-prow-number { font-weight: 600; }
.om-prow-status { font-weight: 600; color: var(--status); }
.om-prow-names > .om-prow-patient { font-weight: 600; color: var(--text); }
.om-prow-end { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
.om-prow-end .om-link { padding: 0; font-size: .9rem; }
.om-dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 2px solid var(--text);
    /* margin-bottom: .2rem; */
}
.om-dot-new { background: var(--accent); border-color: var(--accent); }
/* A calmer size: everything is sized in rem, so this one line scales the portals. */
html { font-size: 13px; }
body {
    font-size: 1rem;
    line-height: 1.45;
}
.om-page-header h1, .om-list-actions h1 { font-size: 1.35rem; }
.om-detail-pane h2, .om-card h2 { font-size: 1.05rem; }
.om-card h1 { font-size: 1.3rem; }
.om-topbar-brand { font-size: 1rem; }
a.om-link { text-decoration: none; }
/* Narrower columns: the list beside the details (the sidebar is as wide as its content). */
.om-split { grid-template-columns: minmax(18rem, 30rem) minmax(0, 1fr); }
/* Two columns: the navigation in a row under the top bar. */
.om-body-row { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.om-navrow { display: flex; align-items: center; gap: .25rem; padding: .35rem 1.25rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.om-navrow .om-side-heading { margin: 0 .25rem 0 1rem; }
.om-navrow .om-side-heading:first-child { margin-left: 0; }
.om-navrow .om-side-item, .om-navrow .om-side-indent { width: auto; padding: .3rem .65rem; white-space: nowrap; }
/* The developer's adjustments: the search field pushes to the right; the end group follows it. */
.om-topbar-end { margin-left: 0; }
.om-search-field { margin-left: auto; }
/* Forms and settings pages on the frame: a readable width. */
.om-narrow > * { max-width: 46rem; }
/* A field with its button inside it (Save, Send a code): one box, the button at its right end. */
.om-inline { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 3px; }
.om-inline:focus-within { border-color: var(--accent); }
.om-field .om-inline input { flex: 1; min-width: 0; border: 0; background: transparent; padding: .45rem .55rem; outline: none; color: var(--text); }
.om-inline-button { flex: none; padding: .35rem .8rem; border: 0; border-radius: 6px; background: var(--raised); color: var(--text); }
.om-inline-button:hover { background: var(--accent-soft); color: var(--accent); }
.om-inline-primary { background: var(--accent); color: white; }

/* The uploader's pages: always on the page, hidden unless open (an upload goes on meanwhile). */
.om-hidden { display: none !important; }
.om-uploader-page { flex: 1; }
.om-pane { display: contents; }
/* A drop zone for one file (a template): like the uploader's. */
.om-drop { border: 2px dashed var(--line); border-radius: 10px; padding: 2rem 1rem; text-align: center; cursor: pointer; margin: .75rem 0 1rem; }
.om-drop:hover, .om-drop-over { border-color: var(--accent); background: var(--accent-soft); }
.om-drop strong { display: block; font-size: 1.05rem; margin-bottom: .35rem; }
.om-case-uploader { margin: .75rem 0 1.25rem; }
/* The details column starts with its heading: no line above it (nothing comes before it). */
.om-detail-pane.om-form-page .om-pane > h2:first-child,
.om-detail-pane.om-form-page .om-pane > .om-template-title:first-child h2 { border-top: 0; padding-top: 0; margin-top: 0; }
.om-template-title h2 { margin: 0; }
.om-detail-pane .om-template-title { margin-bottom: 1rem; }
/* The placeholders: the token in its own column, its meaning beside it (wrapping under itself). */
.om-placeholder { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; align-items: baseline; padding: .45rem 0; border-bottom: 1px solid var(--line); }
/* The HIPAA note on the sign-in page: red, to be read. */
.om-hipaa { margin: 1rem 0; padding: .85rem 1rem; border-radius: 8px; border-left: 4px solid #cf222e; background: rgba(207, 34, 46, .08); }
.om-hipaa p { margin: 0; }
.om-hipaa .om-hipaa-title { font-weight: 700; color: #cf222e; margin-bottom: .35rem; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .om-hipaa { background: rgba(255, 99, 99, .12); } :root:not([data-theme="light"]) .om-hipaa .om-hipaa-title { color: #ff7b72; } }
:root[data-theme="dark"] .om-hipaa { background: rgba(255, 99, 99, .12); }
:root[data-theme="dark"] .om-hipaa .om-hipaa-title { color: #ff7b72; }

/* Template badges in the list (the file's kind, Default, Retired), as on the old templates modal. */
.om-badges { display: flex; align-items: center; gap: .35rem; margin-bottom: .3rem; }
.om-badge.om-badge-good { background: rgba(45, 164, 78, .12); color: var(--completed); border-color: rgba(45, 164, 78, .4); }
.om-danger { color: var(--bad); }

/* A template's rules: each a card with its three lists (Doctors, Practices, Services). */
.om-rules-head { display: flex; align-items: center; justify-content: space-between; margin-top: 1.5rem; }
.om-rules-head h2 { margin: 0; }
.om-rule { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; margin: .75rem 0; }
.om-rule-toggle { display: grid; grid-template-columns: 1.2rem 7rem 1fr; align-items: baseline; width: 100%;
  background: none; border: 0; padding: .35rem 0; text-align: left; color: var(--text); }
.om-rule-arrow { font-size: .75rem; }
.om-rule-name { font-weight: 600; }
.om-rule-choices { display: flex; flex-direction: column; gap: .15rem; max-height: 16rem; overflow-y: auto; padding: .25rem 0 .5rem 1.2rem; }
.om-rule-choices input { margin-bottom: .35rem; }
.om-rule-choice { background: none; border: 0; padding: .2rem 0; text-align: left; color: var(--text); }
.om-rule-choice-on { color: var(--accent); }
.om-rule-actions { display: flex; justify-content: flex-end; }
.om-pills { display: flex; flex-wrap: wrap; gap: .5rem; }

/* A case's history: days as headings, each event a line with its time. */
.om-history-head { display: flex; align-items: baseline; justify-content: space-between; margin-top: 1.5rem; }
.om-history-head h2 { margin: 0; }
.om-history-day h3 { font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin: 1rem 0 .35rem; }
.om-history-event { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: .5rem; align-items: baseline; padding: .3rem 0;
  border-bottom: 1px solid var(--line); }
.om-history-time { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.om-inline-link { margin-left: .6rem; padding: 0; font-size: .9rem; }
.om-picker { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; margin: .25rem 0 1rem; }

/* A titled section inside a list pane, lined up with the pane's notes and tables. */
.om-list-section { padding: 0 1rem; margin-top: 1.5rem; }
.om-list-section h2 { font-size: 1.1rem; margin: 0 0 .35rem; }
.om-list-section h3 { font-size: .95rem; margin: 1rem 0 .25rem; }
.om-list-section .om-rule-choices { padding-left: 0; }
/* A practice's ranked radiologists: its place, the name (cut with "…"), then Up, Down, Remove. */
.om-ranked { display: grid; grid-template-columns: 1.75rem minmax(0, 1fr) auto; gap: .5rem; align-items: center;
  padding: .45rem 0; border-bottom: 1px solid var(--line); }
.om-ranked > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.om-ranked-actions { display: flex; gap: .6rem; }
.om-ranked-actions .om-link { padding: 0; }

/* Links side by side on the sign-in card ("Send a new code", "Start over"): a gap between them. */
.om-card .om-link + .om-link { margin-left: 1.5rem; }

/* "Remove from the team?": asked in place, with a red button that says what it does. */
.om-confirm { border: 1px solid var(--line); border-left: 4px solid var(--bad); border-radius: 8px; padding: .6rem .9rem; margin: .5rem 0; }
.om-confirm p { margin: 0 0 .5rem; }
.om-danger-button { background: var(--bad); color: #fff; border: 0; border-radius: 6px; padding: .45rem .9rem; }
/* The admin portal's audit search: its filters side by side, and the kinds of entry as pills. */
.om-audit-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0 .75rem; }
.om-pills { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 1rem; }
/* An agreement's words, as published (line breaks kept). */
.om-agreement-text { white-space: pre-wrap; max-height: 24rem; overflow: auto; margin: .5rem 0 1rem; padding: 1rem;
  border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: .9rem; }
/* A small labeled field beside a button (the report's date). */
.om-inline-label { display: inline-flex; align-items: center; gap: .5rem; }
.om-inline-label input { padding: .35rem .5rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
/* A case's consults: each one a card, its messages in order, the reader's own set off. */
.om-consult { border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; margin: .5rem 0 1rem; }
.om-consult-message { margin: .5rem 0; padding: .5rem .75rem; border-radius: 8px; background: var(--surface); }
.om-consult-message p { margin: .25rem 0 0; white-space: pre-wrap; }
.om-consult-mine { background: var(--accent-soft); }
/* "Ask a colleague": a name filter over a scrolling list (radiology groups can be large), and a message box. */
.om-find-field { width: 100%; padding: .5rem .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; margin: .25rem 0 .5rem; }
.om-pick-list { max-height: 15rem; overflow: auto; border: 1px solid var(--line); border-radius: 8px; margin-bottom: .75rem; }
.om-pick { display: flex; justify-content: space-between; width: 100%; padding: .5rem .75rem; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--text); text-align: left; }
.om-pick:last-child { border-bottom: 0; }
.om-pick:hover { background: var(--surface); }
.om-pick-on { background: var(--accent-soft); color: var(--accent); }
.om-pick-off { opacity: .5; cursor: default; }
.om-textarea { display: block; width: 100%; min-height: 5rem; padding: .6rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; resize: vertical; margin: .25rem 0 .5rem; }
/* A consult's colleagues, side by side; those taken out struck through. */
.om-consult-members { display: flex; flex-wrap: wrap; gap: .4rem .9rem; margin: .25rem 0 .5rem; }
.om-consult-member { display: inline-flex; gap: .4rem; align-items: baseline; }
.om-consult-member-out { text-decoration: line-through; color: var(--muted); }
/* Whose case it is: "You" in the accent color, a radiologist's initials, or "Unassigned". */
.om-reader { flex: none; min-width: 2.2rem; padding: .1rem .45rem; border: 1px solid var(--line); border-radius: 999px; font-size: .75rem; text-align: center; color: var(--muted); }
.om-reader-you { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.om-reader-none { border-style: dashed; }
/* Someone else's case, dimmed when the person chose it. */
.om-row-others { opacity: .45; }
.om-row-others:hover, .om-row-others.om-selected { opacity: 1; }
/* The number beside a sidebar view, and the tools under the list's title. */
.om-side-item { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.om-side-count { font-size: .75rem; padding: 0 .45rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.om-list-tools { display: flex; flex-wrap: wrap; gap: .4rem; padding: .75rem; justify-content: space-between; }
.om-reader-chooser { padding: 0 .75rem .5rem; }
/* ⌘K's filters: tokens before the text, in the field's own border. */
.om-palette-field { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .3rem .4rem; border: 1px solid var(--accent); border-radius: 8px; background: var(--bg); }
.om-palette-field input, .om-palette-field input:focus { width: auto; flex: 1 1 10rem; min-width: 8rem; border: 0; padding: .4rem .5rem; background: none; }
.om-palette-token { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .3rem .15rem .6rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .9rem; }
.om-palette-token-x { border: 0; background: none; color: inherit; padding: 0 .2rem; font-size: .8rem; }

/* Downloads: a panel in the corner, kept on the page while other pages are open. */
.om-download-panel { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; width: min(28rem, calc(100vw - 2rem)); max-height: 60vh; overflow: auto; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.om-download-panel-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; padding: .5rem .75rem; background: var(--raised); border-bottom: 1px solid var(--line); font-weight: 600; }
.om-download-panel #om-downloader { padding: .5rem .75rem; }

/* The date menu (the old portal's): the day printed on the reports, then the download. */
.om-menu-anchor { position: relative; display: inline-flex; }
.om-menu-backdrop { position: fixed; inset: 0; z-index: 49; }
.om-date-menu { position: absolute; top: calc(100% + .4rem); right: 0; z-index: 50; width: 21rem; padding: 1rem 1rem .75rem; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); text-align: left; }
.om-date-menu h3 { margin: 0 0 .35rem; font-size: 1.05rem; }
.om-date-menu > p { margin: 0 0 .6rem; font-size: .9rem; }
.om-date-choice { display: flex; justify-content: space-between; width: 100%; padding: .45rem .25rem; border: 0; border-radius: 6px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.om-date-choice:hover { background: var(--selected); }
.om-date-menu-other { margin-top: .5rem; padding-top: .6rem; border-top: 1px solid var(--line); }
.om-date-menu-row { display: flex; gap: .5rem; margin-top: .35rem; margin-bottom: 1rem; }
.om-date-menu-row input { flex: 1; padding: .35rem .5rem; font: inherit; border: 1px solid var(--line); border-radius: 8px; }
.om-date-menu-note { margin: .6rem 0 0; padding-top: .5rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }

/* A case's files: the dot, the name (download) and when, the size, then the actions. */
.om-file-row { display: grid; grid-template-columns: 1.2rem 1fr 6rem auto; align-items: center; gap: .75rem; padding: .5rem 0; border-bottom: 1px solid var(--line); }
.om-file-name { display: flex; flex-direction: column; min-width: 0; }
.om-file-name .om-link { padding: 0; text-align: left; overflow-wrap: anywhere; }
.om-file-name .om-muted { font-size: .8rem; }
.om-file-actions { display: flex; gap: 1rem; align-items: center; justify-content: flex-end; }
.om-file-actions .om-link { padding: 0; }
.om-dot-button { padding: 0; cursor: pointer; }
.om-dot-button:not(.om-dot-new) { background: none; }

/* A case another practice shared with this office. */
.om-badge-referred { align-self: center; white-space: nowrap; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; }

/* A question above the page (a share to accept, "Do you own…?"): only as tall as itself. */
.om-question-slot { flex: none; padding: 1rem; }
.om-question-slot .om-notice { margin: 0; }
/* An invoice still owed after its charge day. */
.om-badge.om-badge-late { background: rgba(207, 34, 46, .1); color: var(--deleted); border-color: rgba(207, 34, 46, .4); }
/* An invoice's details: its title and buttons (not sticky, unlike a list's), and a line item's little menu. */
.om-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.om-detail-head h1 { margin: 0; font-size: 1.35rem; }
.om-line-item { position: relative; }
.om-line-menu { position: absolute; z-index: 5; left: 1rem; top: 100%; display: flex; flex-direction: column; min-width: 12rem; padding: .25rem; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, .15); }
/* An account's card on the Invoices page: its name and card, and Add or Replace. */
.om-card-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px; margin: .5rem 1rem; }
.om-card-row p { margin: .15rem 0 0; }
/* Messages on a case: each message, the unread ones marked, and the box to write one. */
.om-message { padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 8px; margin: .5rem 0; }
.om-message-unread { border-left: 3px solid var(--submitted, #2f6fde); }
.om-message-head { display: flex; flex-wrap: wrap; gap: .4rem; align-items: baseline; }
.om-message-text { white-space: pre-wrap; margin: .4rem 0; }
.om-message-compose { margin-top: .75rem; }

/* Attention flags: a flagged case is yellow wherever it shows (its row's bar, its badge, the notice
   at the top of a client's portal, the flags on its page), so clients can't miss it. */
:root { --attention: #e3b341; }
.om-status-attention { --status: var(--attention); }
.om-badge-attention { background: var(--attention); border-color: var(--attention); color: #1f1f1f; font-weight: 600; }
.om-attention-notice { background: rgba(227, 179, 65, .22); border: 1px solid var(--attention); }
.om-attention { margin: .8rem 0; padding: .8rem 1rem; border-radius: 8px; border: 2px solid var(--attention); background: rgba(227, 179, 65, .14); }
.om-attention h2 { margin-top: 0; }
.om-attention-flag { border-left: 4px solid var(--attention); padding: .2rem .7rem; margin: .5rem 0; }
.om-attention-flag p { margin: .2rem 0 0; }
.om-attention-note { font-size: .9rem; color: var(--muted); }
.om-flag-choices { flex-wrap: wrap; }

/* Our admin viewing a portal as someone: impossible to miss, across the top. */
.om-viewing-as { display: flex; gap: 1rem; align-items: center; justify-content: space-between; padding: .5rem 1rem;
  background: #8250df; color: #fff; }
.om-viewing-as .om-button { background: #fff; color: #1f1f1f; }

/* Contact support (every portal's top bar): a panel at the top right, over the page. */
.om-contact-panel { position: fixed; right: 1rem; top: 3.5rem; z-index: 45; width: min(26rem, calc(100vw - 2rem)); padding-bottom: .75rem; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
.om-contact-panel > p, .om-contact-panel > label, .om-contact-panel > .om-buttons { margin-left: .75rem; margin-right: .75rem; }
.om-contact-phone { margin: .75rem .75rem .25rem; text-align: center; }
.om-contact-phone p { margin: .2rem 0; }
.om-contact-number { display: block; font-size: 1.6rem; font-weight: 700; color: inherit; text-decoration: none; }
