/* Hosted platform additions to app.css (the shared clinician styles):
   account menu, sign-in pages, security and admin. Same palette. */
.topbar .account { display: flex; align-items: center; gap: 14px; }
.topbar .org { color: var(--ink); font-weight: 500; text-decoration: none; }
.menu { position: relative; }
.menu summary { cursor: pointer; list-style: none; color: var(--mute); padding: 6px 10px; border-radius: var(--radius-btn); display: inline-flex; align-items: center; gap: 6px; }
.menu-name { text-transform: capitalize; }
.menu-tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-text); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 4px; padding: 0 5px; line-height: 16px; }
.menu-chevron { transition: transform .15s; }
.menu[open] .menu-chevron { transform: rotate(180deg); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { background: var(--hover); color: var(--ink); }
.menu-body { position: absolute; right: 0; top: 36px; min-width: 180px; padding: 8px; display: flex; flex-direction: column; gap: 4px; z-index: 5; }
.menu-body a, .menu-body .link { padding: 6px 8px; font-size: 14px; text-align: left; text-decoration: none; }
.menu-body form { margin: 0; }
.narrow-page { max-width: 620px; margin: 0 auto; }
.narrow-page .form { grid-template-columns: 180px 1fr; }
.pad { padding: 16px 20px; margin-bottom: 16px; }
.card + .card, .card + form, form + .card { margin-top: 16px; }
.pad h2 { margin-bottom: 8px; }
h2.section { margin: 24px 0 10px; }
.secret { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 18px; letter-spacing: .06em; background: var(--hover); padding: 10px 14px; border-radius: var(--radius); word-break: break-all; }
.qr { background: var(--paper); display: inline-block; padding: 8px; border: 1px solid var(--paper-line); border-radius: var(--radius); margin: 4px 0 12px; }
.qr svg { display: block; }
.codes { columns: 2; font-family: ui-monospace, "SF Mono", Menlo, monospace; padding-left: 20px; }
input[type=password] { border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 10px; background: var(--card); color: var(--ink); line-height: 1.3; }
.form input[type=password] { width: 100%; max-width: 440px; }
.password-field { position: relative; display: inline-block; vertical-align: middle; }
.form .password-field { display: block; width: 100%; max-width: 440px; }
.password-field input { border: 1px solid var(--line); border-radius: var(--radius); padding: 7px 40px 7px 10px; background: var(--card); color: var(--ink); line-height: 1.3; }
.form .password-field input { width: 100%; max-width: none; }
.password-reveal { position: absolute; top: 0; right: 0; bottom: 0; width: 38px; display: flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--mute); cursor: pointer; border-radius: 0 var(--radius) var(--radius) 0; }
.password-reveal:hover { color: var(--ink); }
.password-reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 720px) {
  .form, .narrow-page .form { grid-template-columns: 1fr; }
}
tr.changed td { background: var(--attn-soft); }
/* Password meter (password_meter.js): weak red, OK amber, strong green. */
.password-meter { display: flex; align-items: center; gap: 10px; margin-top: 6px; min-height: 18px; font-size: 13px; color: var(--mute); }
.password-meter .bar { display: inline-flex; gap: 4px; }
.password-meter .bar span { width: 38px; height: 6px; border-radius: 3px; background: var(--line); }
.password-meter[data-level="weak"] .bar span:nth-child(1) { background: var(--fail); }
.password-meter[data-level="ok"] .bar span:nth-child(-n+2) { background: var(--warn); }
.password-meter[data-level="good"] .bar span { background: var(--ok); }
.password-meter[data-level="weak"] .label { color: var(--fail); }
.password-meter[data-level="ok"] .label { color: var(--warn); }
.password-meter[data-level="good"] .label { color: var(--ok); }
.password-match { margin-top: 6px; min-height: 18px; font-size: 13px; }
.password-match[data-state="match"] { color: var(--ok); }
.password-match[data-state="differ"] { color: var(--fail); }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }

/* The evaluation bench (/admin/bench) */
.bench-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.bench-nav { display: flex; flex-wrap: wrap; gap: 4px; }
.bench-nav a { padding: 6px 12px; border-radius: var(--radius-btn); text-decoration: none; color: var(--ink); border: 1px solid transparent; }
.bench-nav a.on { border-color: var(--line); background: var(--card); font-weight: 600; }
.bench-org { display: flex; align-items: center; gap: 8px; }
.bench-warning { margin: 0 0 16px; }
.bench-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.bench-grid > .card + .card { margin-top: 0; }
.bench-pre, .compare-text { white-space: pre-wrap; word-break: break-word; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0; max-height: 70vh; overflow: auto; }
.bench-panel { padding: 14px 16px; }
.bench-panel h3 { margin: 0 0 8px; font-size: 15px; }
.bench-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.bench-inline label { color: var(--mute); font-size: 14px; }
.compare-grid { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(320px, 1fr); gap: 12px; overflow-x: auto; }
.compare-column.compare-base { outline: 2px solid var(--accent); }
mark.compare-added { background: var(--diff-added); }
mark.compare-removed { background: var(--diff-removed); text-decoration: line-through; }
.bench-range { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.bench-presets { display: inline-flex; flex-wrap: wrap; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 3px; }
.bench-presets a { padding: 5px 12px; border-radius: 6px; text-decoration: none; color: var(--mute); font-size: 14px; white-space: nowrap; }
.bench-presets a:hover { color: var(--ink); background: var(--hover); }
.bench-presets a.on { color: var(--ink); background: var(--active); font-weight: 600; }
.scenario { display: flex; flex-direction: column; gap: 14px; }
.scenario h3 { margin: 0; }
.scenario-prices { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px 12px; }
.scenario-prices label { color: var(--mute); font-size: 14px; }
.price-input { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.price-input:focus-within { border-color: var(--accent); }
.price-input span { padding: 0 8px; color: var(--mute); font-size: 14px; background: var(--card-2); align-self: stretch; display: flex; align-items: center; }
.price-input.pounds span { border-right: 1px solid var(--line); }
.price-input:not(.pounds) span { border-left: 1px solid var(--line); }
.price-input input[type=text] { border: 0; border-radius: 0; width: 76px; text-align: right; font-variant-numeric: tabular-nums; }
.price-input input[type=text]:focus { outline: none; }
.scenario-result { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: auto 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; }
.scenario-result dt { color: var(--mute); }
.scenario-result dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.scenario-result dd.loss { color: var(--fail); font-weight: 600; }
.scenario-actions { display: flex; align-items: center; gap: 14px; margin-top: 14px; font-size: 14px; }
.cost-length p { margin: 0 0 12px; }
.cost-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 6px; }
.cost-key { display: inline-flex; align-items: center; gap: 6px; }
.cost-key::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot); }
.cost-key.consultation { --dot: #2a78d6; }
.cost-key.dictation { --dot: #eb6834; }
.cost-key.fit::before { width: 16px; height: 0; border-radius: 0; border-top: 2px dashed var(--mute); background: none; }
.cost-scatter { display: block; width: 100%; height: auto; margin-bottom: 12px; }
.cost-scatter text { font-size: 11px; fill: var(--mute); }
.cost-scatter .grid { stroke: var(--chart-grid); }
.cost-scatter .fit { stroke: var(--mute); stroke-dasharray: 4 3; stroke-width: 1.5; }
.cost-scatter .hit { fill: transparent; }
.cost-scatter .point { stroke: var(--card); stroke-width: 2; }
.cost-scatter .point.consultation { fill: #2a78d6; }
.cost-scatter .point.dictation { fill: #eb6834; }
.cost-scatter a:hover .point, .cost-scatter a:focus .point { stroke: var(--ink); }
.cost-modes { margin-bottom: 8px; }
.cost-modes th, .cost-modes td { padding: 8px 10px; }
/* Cost by stage (bench costs page): one fixed colour per stage. */
.stage-transcription { --stage: #2a78d6; }
.stage-extraction { --stage: #eb6834; }
.stage-draft { --stage: #1baf7a; }
.stage-check { --stage: #eda100; }
.stage-revision { --stage: #e87ba4; }
.stage-summary { --stage: #008300; }
.stage-minutes { --stage: #4a3aa7; }
.stage-other { --stage: #8a94a3; }
.stage-bar { display: flex; gap: 2px; height: 12px; min-width: 120px; }
.stage-bar > span { background: var(--stage); border-radius: 3px; min-width: 3px; }
.stage-bar.large { height: 24px; margin-bottom: 10px; }
.stage-keys { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; }
.stage-key { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.stage-key::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--stage); }
.stage-table th, .stage-table td { padding: 8px 10px; }
th.split, td.split { width: 160px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-top: 12px; }
.pager-pages, .pager-size { display: inline-flex; align-items: center; gap: 10px; }
.pager .btn[aria-disabled="true"] { opacity: .5; cursor: default; }
/* Sortable list headers (web/list_page.js): the header is the link. */
.list th a.sort { color: inherit; text-decoration: none; white-space: nowrap; }
.list th a.sort:hover { text-decoration: underline; }
.list th[aria-sort] a.sort { color: var(--ink); }
.list td.nowrap { white-space: nowrap; }
.per-page { justify-content: flex-end; margin: 0 0 8px; }

/* Feedback to ClinoVoice (docs/feedback-plan.md): the drawer's entries and
   form, the bench's platform-only notes, the top bar's Feedback menu and the
   one-line ask after approving an edited letter. */
.feedback-entry { padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.feedback-entry:first-of-type { border-top: 0; }
.feedback-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; color: var(--mute); font-size: 13px; }
.feedback-meta .who { color: var(--ink); font-weight: 500; }
.feedback-body { margin-top: 3px; white-space: pre-wrap; line-height: 1.5; }
.feedback-entry.platform-only { border-left: 3px solid var(--warn); padding-left: 10px; margin-left: -13px; background: var(--attn-faint); }
.feedback-form { display: grid; grid-template-columns: 200px 1fr; gap: 10px 14px; align-items: start; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.feedback-form textarea { width: 100%; min-height: 72px; resize: vertical; }
.feedback-form .foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.feedback-form .choices { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.feedback-form .choices label { display: flex; gap: 8px; align-items: baseline; }
.feedback-form .choices .mute { display: block; }
.pill.platform { border-color: var(--warn); color: var(--attn); background: var(--attn-soft); }
.pill.open { border-color: var(--accent-line); color: var(--accent-text); background: var(--accent-soft); }
td.feedback-text { max-width: 420px; white-space: pre-wrap; }
/* The top bar's Feedback is a details/summary like the account menu, so it
   needs no script. Long organisation names truncate rather than wrap. */
.feedback-menu summary { padding: 6px 10px; font-size: 14px; color: var(--mute); }
.topbar .org, .topbar .menu-name { white-space: nowrap; }
.topbar .org { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.feedback-menu .menu-body { width: 420px; max-width: calc(100vw - 32px); padding: 14px 16px; gap: 10px; }
.feedback-menu .menu-body h2 { margin-bottom: 2px; }
.feedback-menu select { width: 100%; }
.feedback-menu textarea { width: 100%; min-height: 84px; resize: vertical; }
.feedback-menu .foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.message.ask { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.message.ask input[type=text] { flex: 1 1 320px; }
.message.ask .link { color: var(--accent-text); }
@media (max-width: 720px) {
  .feedback-form { grid-template-columns: 1fr; }
}

/* The account avatar in the top bar: initials on sage-soft. */
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; letter-spacing: .02em; flex: 0 0 auto; }
.menu summary { gap: 8px; }

/* Sign in and the other signed-out pages: the website's shape, a centred
   column with the brand, a 20 px card of 12 px fields and a full-width pill
   button. Signed out, the top bar gives way to the column's brand; signed in
   (enrolment, no organisation) the top bar stays and the column's brand goes. */
.signed-out:has(.signin) .topbar { display: none; }
body:not(.signed-out) .signin > .brand { display: none; }
.signin { max-width: 440px; margin: 48px auto 0; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.signin > .brand { display: inline-flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 500; color: var(--ink); text-decoration: none; }
.signin > .brand .brand-mark { width: 34px; height: 34px; }
.signin > .card { width: 100%; padding: 28px 28px 24px; border-radius: 20px; }
.signin h1 { font-size: 30px; margin-bottom: 20px; }
.signin .field { margin-bottom: 16px; }
.signin .field label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; }
.signin .field .meta { display: flex; justify-content: space-between; align-items: baseline; }
.signin .field .meta label { margin-bottom: 6px; }
.signin .field .meta a { font-size: 13px; text-decoration: none; }
.signin .field input, .signin .field .password-field { width: 100%; }
.signin .field input { font-size: 16px; padding: 11px 14px; border-radius: 12px; }
.signin .field .password-field input { padding-right: 44px; }
.signin .btn.primary { width: 100%; padding: 12px 20px; font-size: 16px; margin-top: 6px; }
.signin .or { display: flex; align-items: center; gap: 12px; color: var(--mute); font-size: 13px; margin: 18px 0 12px; }
.signin .or::before, .signin .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.signin .btn.passkey { width: 100%; padding: 11px 20px; text-align: center; }
.signin .cancel { text-align: center; margin: 14px 0 0; font-size: 14px; }
.signin > .mute { text-align: center; max-width: 34em; margin: 0; }
.signin-foot { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; font-size: 13px; color: var(--mute); }
.signin-foot a { color: var(--mute); text-decoration: none; }
.signin-foot a:hover { color: var(--ink); text-decoration: underline; }

/* Appearance: the account menu's row, and the signed-out corner toggle. */
.menu-body .appearance { padding: 8px; border-top: 1px solid var(--line); margin-top: 4px; }
.menu-body .appearance .mute { display: block; margin-bottom: 6px; }
.menu-body .appearance .seg { display: flex; }
.menu-body .appearance .seg button { flex: 1; text-align: center; font-size: 13px; padding: 6px 8px; }
.theme-corner { position: absolute; top: 16px; right: 20px; padding: 8px 10px; line-height: 0; }

/* The account page (/account): the account menu as a page of inset groups,
   hairline-separated rows with chevrons, the pattern of a phone's settings. */
.account-page { max-width: 560px; margin: 0 auto; }
.account-page .me { display: flex; align-items: center; gap: 14px; margin: 6px 0 26px; }
.account-page .me .avatar { width: 52px; height: 52px; font-size: 17px; }
.account-page .me .name { display: block; font-weight: 500; font-size: 18px; }
.account-page .me .mute { font-size: 14px; }
.account-page .group { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; margin: 0 0 18px; }
.account-page .group > a, .account-page .group > .item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; font-size: 16px; color: var(--ink); text-decoration: none; border-top: 1px solid var(--line); }
.account-page .group > :first-child { border-top: 0; }
.account-page .group > a svg { margin-left: auto; width: 16px; height: 16px; color: var(--line-strong); flex: 0 0 auto; }
.account-page .group .item .seg { margin-left: auto; }
.account-page .group .item .seg button { padding: 6px 12px; font-size: 13px; }
.account-page .caption { color: var(--mute); font-size: 13px; margin: -8px 0 18px 16px; }
.account-page .feedback { display: grid; gap: 10px; padding: 14px 16px; }
.account-page .feedback h2 { margin: 0; }
.account-page .feedback select, .account-page .feedback textarea { width: 100%; }
.account-page .feedback textarea { min-height: 96px; resize: vertical; }
.account-page .feedback .foot { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.account-page .signout { display: block; width: 100%; text-align: left; padding: 14px 16px; font-size: 16px; color: var(--fail); background: none; border: 0; cursor: pointer; }
.signin .phone-label { display: none; }
/* Sign in on a phone: no card, the fields on the page, the passkey a line of
   text, and the invitation note and links at the bottom. */
@media (max-width: 720px) {
  .signin { max-width: none; margin: 0; align-items: stretch; gap: 0; min-height: calc(100dvh - 40px - env(safe-area-inset-top)); padding-top: 18px; }
  .signin > .brand { margin-bottom: 36px; font-size: 20px; gap: 10px; }
  .signin > .brand .brand-mark { width: 30px; height: 30px; }
  .signin > .card { padding: 0; border: 0; border-radius: 0; background: none; }
  .signin h1 { font-size: 32px; margin-bottom: 26px; }
  .signin .field { margin-bottom: 18px; }
  .signin .field input { padding: 13px 16px; }
  .signin .btn.primary { padding: 14px 20px; margin-top: 8px; }
  .signin .or { display: none; }
  .signin .btn.passkey { display: block; width: auto; margin: 18px auto 0; padding: 6px 10px; border: 0; background: none; color: var(--accent); font-size: 15px; min-height: 0; }
  .signin .wide-label { display: none; }
  .signin .phone-label { display: inline; }
  .signin > .mute { margin-top: auto; padding-top: 40px; }
  .signin-foot { margin-top: 14px; padding-bottom: env(safe-area-inset-bottom); }
  .theme-corner { top: calc(10px + env(safe-area-inset-top)); right: 12px; }
}
