/* Aurikal app: sign-in and dashboard. Builds on the tokens in styles.css. */

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.fine { font-size: 13px; color: var(--muted); }
.empty { color: var(--muted); padding: 16px 4px; list-style: none; }

/* ---- Sign-in ---------------------------------------------------------------- */

.login-body {
  min-height: 100vh; min-height: 100dvh;
  background: radial-gradient(900px 480px at 85% -10%, var(--blush), transparent 60%), var(--tint);
}
.login-wrap {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  padding-block: max(32px, env(safe-area-inset-top, 0px)) max(32px, env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.login-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 24px; padding: 36px 32px; display: grid; gap: 24px; box-shadow: var(--shadow);
}
.login-head { display: grid; gap: 8px; }
.login-head h1 { font-size: 30px; color: var(--ink); }
.login-head p { color: var(--muted); }
.login-head a { color: var(--ink); }
.login-error {
  background: var(--blush); color: var(--rose-strong); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-weight: 500;
}
.sso { display: grid; gap: 12px; }
.sso-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 18px;
  font: 600 16px var(--f-body); color: var(--text); text-decoration: none; background: var(--bg);
  transition: border-color .15s ease, transform .15s ease;
}
.sso-btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.sso-btn svg { width: 22px; height: 22px; flex: none; }
.sso-dev { border-style: dashed; color: var(--muted); }
.login-note { font-size: 14px; color: var(--muted); }
.login-fine { font-size: 13px; color: var(--muted); }
.login-ok {
  background: color-mix(in srgb, #2E7D4F 12%, var(--surface)); color: #1F5E3A; border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-weight: 500;
}
.login-view { display: grid; gap: 20px; }
.login-form, .login-more { display: grid; gap: 16px; }
.login-form .btn { width: 100%; justify-content: center; }
.login-form .field input { width: 100%; }
.login-links { font-size: 14px; color: var(--muted); text-align: center; }
.login-links a { color: var(--ink); }
.or-divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.enroll-steps { display: grid; gap: 12px; padding-left: 20px; font-size: 15px; }
.qr-img { display: block; width: 200px; height: 200px; margin: 12px auto 4px; background: #FFFFFF; border-radius: 12px; border: 1px solid var(--line); }
.enroll-key { font-size: 14px; color: var(--muted); margin-top: 6px; }
.enroll-key summary { cursor: pointer; color: var(--ink); }
.enroll-key code { font: 500 14px var(--f-mono); color: var(--ink); word-break: break-all; }
.recovery-codes {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px; list-style: none; padding: 16px;
  background: var(--bg); border: 1px solid var(--line); border-radius: 14px; font: 500 16px var(--f-mono); color: var(--ink);
}
.login-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.check { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 14px; line-height: 1.45; cursor: pointer; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: #13315C; }

/* ---- App header ------------------------------------------------------------- */

.app-body { background: var(--tint); min-height: 100vh; min-height: 100dvh; }
.app-header {
  position: sticky; top: 0; z-index: 40; background: var(--surface);
  border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px);
}
.app-header-inner {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap; min-height: 68px; padding-block: 10px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.specialty-picker { display: flex; align-items: center; gap: 10px; flex: 1 1 320px; min-width: 0; max-width: 520px; }
.specialty-picker label { font: 500 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
select {
  font: 500 15px var(--f-body); color: var(--text); background-color: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 36px 10px 12px; min-width: 0;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%2356627C' stroke-width='2' stroke-linecap='round' d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
select:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 35%, transparent); }
.specialty-picker select { flex: 1; width: 100%; font-weight: 600; color: var(--ink); }
.user-menu { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.user-name { font-size: 14px; color: var(--muted); max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.offline-banner {
  background: #7A4B00; color: #FFFFFF; font-size: 14px; text-align: center; padding: 8px 16px;
}

/* ---- Layout ----------------------------------------------------------------- */

.app-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start;
  max-width: 1440px; margin: 0 auto; padding-block: 28px 48px;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.app-main { min-width: 0; }
.view-head { display: grid; gap: 18px; margin-bottom: 22px; }
.view-head h1 { font-size: clamp(26px, 3.4vw, 36px); color: var(--ink); }
.view-sub { color: var(--muted); max-width: 70ch; margin-top: 6px; }
.view-sub-alert { color: var(--rose-strong); font-weight: 600; }
.lang-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.provider-lang { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }

.search {
  display: flex; align-items: center; gap: 8px; background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 0 12px; flex: 1 1 280px; max-width: 460px;
}
.search:focus-within { border-color: var(--ink); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; outline: none; background: transparent; font: 15px var(--f-body); color: var(--text); padding: 11px 0; width: 100%; min-width: 0; }

/* ---- Language grid ---------------------------------------------------------- */

.lang-grid {
  list-style: none; margin: 0 0 16px; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px;
}
.lang-card {
  width: 100%; height: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 16px; display: grid; gap: 4px; align-content: start;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.lang-card:hover { border-color: var(--rose); transform: translateY(-2px); box-shadow: 0 12px 28px -18px rgba(19, 49, 92, .45); }
.lang-flags { display: flex; gap: 6px; min-height: 21px; margin-bottom: 6px; }
.lang-flags img { width: 28px; height: 21px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(19, 49, 92, .14); }
.lang-native { font: 600 22px/1.25 var(--f-display); color: var(--ink); letter-spacing: -.01em; overflow-wrap: anywhere; }
.lang-native[dir="rtl"] { text-align: right; }
.lang-name { font-weight: 600; font-size: 15px; }
.lang-region { font-size: 13px; color: var(--muted); }
.lang-meter { display: block; height: 4px; background: var(--tint); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.lang-meter i { display: block; height: 100%; background: var(--rose); border-radius: 4px; }
.lang-count { font: 400 12px var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---- Session ---------------------------------------------------------------- */

.session-head { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.session-title h1 { font-size: clamp(24px, 3vw, 32px); color: var(--ink); }
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn svg { width: 22px; height: 22px; }

.talk-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.talk {
  border: 0; border-radius: 22px; padding: 26px 20px; cursor: pointer; font: inherit;
  display: grid; justify-items: center; gap: 4px; text-align: center; min-height: 190px; align-content: center;
  transition: transform .12s ease, box-shadow .2s ease, opacity .2s ease;
}
.talk svg { width: 40px; height: 40px; margin-bottom: 6px; }
.talk-who { font: 500 12px var(--f-mono); letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.talk-lang { font: 700 26px/1.2 var(--f-display); letter-spacing: -.02em; }
.talk-hint { font-size: 14px; opacity: .85; }
.talk-row-one { grid-template-columns: 1fr; }
.talk-auto { background: #13315C; color: #FFFFFF; }
.talk-auto .talk-who { text-transform: none; letter-spacing: 0; font: 500 14px var(--f-body); opacity: .8; }
.talk-auto .talk-hint { font-size: 16px; font-weight: 600; opacity: .95; }
.talk-clinician { background: #13315C; color: #FFFFFF; }
.talk-patient { background: #EF6F6C; color: #FFFFFF; }
.talk:hover:not(:disabled) { transform: translateY(-2px); }
.talk:disabled { opacity: .45; cursor: not-allowed; }
.talk.is-recording { box-shadow: 0 0 0 6px color-mix(in srgb, var(--mint) 70%, transparent); animation: rec 1.4s ease-in-out infinite; }
@keyframes rec { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--mint) 25%, transparent); } }

.session-status { margin: 14px 2px; font-size: 15px; color: var(--muted); min-height: 1.5em; }
.session-status.live {
  /* Not the marketing pages' ".live" badge (styles.css): a normal, wrapping status line. */
  display: block; margin-left: 0; white-space: normal; font: 600 15px var(--f-body); color: var(--mint);
}
.session-status.live::before { content: none; }
.session-status.error { color: var(--rose-strong); font-weight: 600; }

.type-row { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.type-row input {
  flex: 1 1 240px; min-width: 0; font: 16px var(--f-body); color: var(--text); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 14px;
}
.type-row input:focus { border-color: var(--ink); outline: none; }

.feed { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 12px; }
.turn { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; display: grid; gap: 8px; border-left: 5px solid var(--ink); }
.turn-patient { border-left-color: var(--rose); }
.turn-error, .turn-unclear { border-left-color: var(--muted); }
.turn-meta { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font: 500 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.turn-original { color: var(--muted); font-size: 15px; }
.turn-translation-row { display: flex; gap: 12px; align-items: flex-start; }
.turn-translation { flex: 1; min-width: 0; font: 600 20px/1.4 var(--f-display); color: var(--text); letter-spacing: -.01em; }
.turn-unclear .turn-translation { font: 500 15px var(--f-body); color: var(--muted); }
.pending { color: var(--muted); font: italic 400 15px var(--f-body); }
.play-btn { width: 40px; height: 40px; }

/* ---- Reference panel -------------------------------------------------------- */

.ref {
  position: sticky; top: calc(84px + env(safe-area-inset-top, 0px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 20px; display: grid; gap: 14px; max-height: calc(100vh - 110px); grid-template-rows: auto auto auto 1fr auto;
}
.ref-head { display: grid; gap: 6px; }
.ref-head h2 { font-size: 20px; color: var(--ink); }
.ref-desc { font-size: 14px; color: var(--muted); }
.tabs { display: flex; gap: 4px; background: var(--tint); border-radius: 12px; padding: 4px; }
.tabs button {
  flex: 1; border: 0; background: transparent; font: 600 13px var(--f-body); color: var(--muted);
  padding: 8px 4px; border-radius: 9px; cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(19, 49, 92, .15); }
.search-sm { max-width: none; flex: none; }
.search-sm input { padding: 8px 0; font-size: 14px; }
.ref-list { list-style: none; margin: 0; padding: 0 4px 0 0; overflow-y: auto; min-height: 0; display: grid; gap: 0; align-content: start; }
.ref-list li { padding: 11px 2px; border-bottom: 1px solid var(--line); display: grid; gap: 3px; font-size: 14px; }
.ref-list li:last-child { border-bottom: 0; }
.ref-list b { font-weight: 600; color: var(--text); }
.ref-list em { font-style: normal; font-weight: 400; color: var(--muted); }
.ref-list span { color: var(--muted); }
.chip {
  justify-self: start; font: 500 11px var(--f-mono); color: var(--ink) !important; background: var(--tint);
  border-radius: 6px; padding: 2px 7px;
}
.ref-list .phrase { grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
.ref-list .phrase span { color: var(--text); }
.say-btn {
  border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font: 600 13px var(--f-body);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; white-space: nowrap;
}
.say-btn:hover { border-color: var(--rose); }
.ref-fine { margin: 0; }

/* ---- Responsive ------------------------------------------------------------- */

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .ref { position: static; max-height: none; grid-template-rows: none; }
  .ref-list { max-height: 420px; }
}
@media (max-width: 640px) {
  .app-header-inner { gap: 10px; }
  .specialty-picker { order: 3; flex-basis: 100%; max-width: none; }
  .user-name { display: none; }
  .talk-row { grid-template-columns: 1fr; }
  .talk { min-height: 130px; padding: 18px; }
  .lang-grid { grid-template-columns: 1fr 1fr; }
  .lang-native { font-size: 19px; }
  .login-card { padding: 28px 22px; }
}

/* ---- Navigation, BAA banner ------------------------------------------------- */

.mode-nav { display: flex; gap: 4px; background: var(--tint); border-radius: 12px; padding: 4px; }
.mode-nav a {
  text-decoration: none; font: 600 14px var(--f-body); color: var(--muted);
  padding: 8px 14px; border-radius: 9px; white-space: nowrap;
}
.mode-nav a:hover { color: var(--text); }
.mode-nav a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(19, 49, 92, .15); }

.baa-banner {
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  background: #13315C; color: #FFFFFF; font-size: 15px; padding-block: 12px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.baa-banner p { max-width: 80ch; }
.btn-light { background: #FFFFFF; color: #13315C; }
.trial-banner {
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  background: #7A4B00; color: #FFFFFF; padding: 12px 20px; font-size: 15px;
}
.trial-banner.is-ended { background: #8C1D18; }
.trial-banner p { max-width: 80ch; margin: 0; }
.role-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.role-row h2 { margin: 0 0 4px; }
.role-warn { margin-top: 14px; border: 1.5px solid #B3261E; background: color-mix(in srgb, #B3261E 8%, var(--surface)); border-radius: 14px; padding: 14px 16px; display: grid; gap: 8px; }
.role-warn p { margin: 0; }
.role-warn-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-light:hover { background: #FDE8E6; }

/* ---- Notes and scribe ------------------------------------------------------- */

.feed-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.feed-head h2 { font-size: 18px; color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }

.scribe-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.rec-btn {
  display: inline-flex; align-items: center; gap: 12px; border: 0; cursor: pointer;
  background: #13315C; color: #FFFFFF; font: 600 17px var(--f-body); padding: 16px 24px; border-radius: 999px;
}
.rec-dot { width: 14px; height: 14px; border-radius: 50%; background: #EF6F6C; }
.rec-time { font: 500 14px var(--f-mono); opacity: .8; font-variant-numeric: tabular-nums; }
.rec-btn.is-recording { background: #B3261E; }
.rec-btn.is-recording .rec-dot { background: #FFFFFF; animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.upload-btn { cursor: pointer; }

#view-scribe { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
#view-scribe[hidden] { display: none; }
#view-scribe .view-head { margin-bottom: 0; }
.field textarea, .transcript-box, .note-box {
  width: 100%; font: 15px/1.55 var(--f-body); color: var(--text); background: var(--surface);
  border: 1.5px solid var(--line); border-radius: 14px; padding: 14px 16px; resize: vertical;
}
.note-box { font-family: var(--f-mono); font-size: 14px; line-height: 1.6; }
.transcript-box:focus, .note-box:focus { border-color: var(--ink); outline: none; }
.note-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.note-options select { width: 100%; }
.note-out { display: grid; gap: 10px; }
.note-out-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.note-out-head h2, .note-out-head h3 { font-size: 18px; color: var(--ink); }
.note-warning { font-size: 14px; color: #7A4B00; background: #FFF4DB; border-radius: 10px; padding: 8px 12px; }

.note-dialog {
  border: 0; border-radius: 22px; padding: 0; width: min(760px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px); background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.note-dialog::backdrop { background: rgba(13, 20, 34, .55); }
.note-dialog-inner { padding: 24px; display: grid; gap: 16px; }

/* ---- Legal pages ------------------------------------------------------------ */

.legal-page {
  max-width: 900px; margin: 0 auto; display: grid; gap: 18px; padding-block: 48px;
  padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px));
}
.legal-page h1 { font-size: 34px; color: var(--ink); }
.legal-page .brand { color: var(--ink); font-weight: 600; text-decoration: none; }
.legal-table { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.legal-table table { border-collapse: collapse; width: 100%; min-width: 560px; font-size: 15px; }
.legal-table th, .legal-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.legal-table th { font: 500 11px var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

@media (max-width: 860px) {
  .mode-nav { order: 2; }
}
@media (max-width: 640px) {
  .mode-nav { flex: 1 1 100%; order: 4; }
  .mode-nav a { flex: 1; text-align: center; }
}
#view-scribe > .btn { justify-self: start; }
.note-dialog-inner > .btn { justify-self: start; }

/* ---- Finishing a recording on a phone ----------------------------------------- */
.finish-dialog { width: min(460px, calc(100vw - 32px)); }
.finish-dialog .note-dialog-inner { gap: 12px; }
.finish-dialog h2 { font-size: 20px; color: var(--ink); }
.finish-choices { display: grid; gap: 10px; }
.finish-choice {
  display: grid; gap: 4px; text-align: left; padding: 14px 16px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit;
}
.finish-choice b { font-size: 17px; color: var(--ink); }
.finish-choice span { font-size: 14px; color: var(--muted); }
.finish-choice:focus-visible { outline: 3px solid var(--accent, #2563eb); outline-offset: 2px; }
.finish-choice.finish-primary { border-color: var(--ink); border-width: 2px; }
.finish-dialog [data-finish="cancel"] { justify-self: center; }
.resume-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; justify-content: space-between; margin-bottom: 12px; }
.resume-row .fine { flex: 1 1 240px; margin: 0; }

/* ---- Op report, profile, NPI picker ----------------------------------------- */

.stack-view { display: grid; gap: 18px; }
.stack-view .view-head { margin-bottom: 0; }
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px;
  display: grid; gap: 14px; min-width: 0;
}
.panel h2 { font-size: 18px; color: var(--ink); }
.panel > .btn { justify-self: start; }
.case-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.field input[type="date"], .field input:not([type]), .field input[type="text"] {
  font: 15px var(--f-body); color: var(--text); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%;
}
.field select { width: 100%; }

.npi-picker { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.npi-field-inline.npi-picker { border-top: 0; padding-top: 0; }
.npi-label { font-size: 14px; font-weight: 600; }
.npi-search { display: flex; gap: 8px; flex-wrap: wrap; }
.npi-search input {
  flex: 1 1 160px; min-width: 0; font: 15px var(--f-body); color: var(--text); background: var(--bg);
  border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 12px;
}
.npi-search .state-input { flex: 0 0 150px; }
.npi-search .zip-input { flex: 0 0 90px; min-width: 0; }
.npi-selected, .npi-results li {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--tint); border-radius: 12px; padding: 10px 14px;
}
.npi-selected > div:first-child, .npi-results li > div { display: grid; gap: 2px; min-width: 0; }
.npi-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 320px; overflow-y: auto; }
.npi-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.assists, .assistants { display: grid; gap: 4px; }
.assist-row { display: grid; grid-template-columns: minmax(0, 1fr) 240px auto; gap: 12px; align-items: end; }
.assist-role { padding-bottom: 2px; }
.assist-remove { margin-bottom: 4px; }

.table-wrap { overflow-x: auto; position: relative; }
table.codes { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 14px; }
table.codes th, table.codes td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.codes th { font: 500 11px var(--f-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
table.codes .num { text-align: right; font-variant-numeric: tabular-nums; }
.code-cell { font-family: var(--f-mono); white-space: nowrap; }
.code-why { display: block; color: var(--muted); font-size: 13px; margin-top: 4px; }
.code-why q { font-style: italic; }
.code-ok { color: var(--ok, #1D7F4E); font-weight: 600; font-size: 13px; }
.code-bad { color: var(--rose-strong); font-weight: 600; font-size: 13px; }
.code-check { color: #7A4B00; font-size: 13px; }
.codes-h { font-size: 15px; color: var(--ink); margin-top: 6px; }
.verify-list { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 14px; }
.ncci-list li.ncci-error::marker { color: #B3261E; }
.ncci-list li.ncci-warn::marker { color: #7A4B00; }
tr.ncci-flag td.code-cell b { text-decoration: underline wavy #7A4B00; text-underline-offset: 3px; }
.op-output { display: grid; gap: 18px; }

.npi-search-row { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.npi-search-row .field { flex: 0 1 260px; }
.prof-id { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.prof-id h2 { font-size: 24px; }
.prof-id p { color: var(--muted); }
.badge { font: 600 12px var(--f-body); border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.badge-ok { background: #E3F4EC; color: #1D7F4E; }
.badge-warn { background: #FFF4DB; color: #7A4B00; }
.check-inline { display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); }
.tpl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tpl-list > li { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; display: grid; gap: 10px; }
.tpl-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.tpl-edit { display: grid; gap: 8px; }
.tpl-title { font: 600 15px var(--f-body); color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 12px; }

@media (max-width: 720px) {
  .assist-row { grid-template-columns: 1fr; }
}
.panel > *, .stack-view > * { min-width: 0; }
@media (max-width: 640px) {
  .mode-nav { overflow-x: auto; scrollbar-width: none; }
  .mode-nav a { padding: 8px 10px; font-size: 13px; flex: 1 0 auto; }
}
#prof-linked { display: grid; gap: 18px; }
.panel .session-status:empty { display: none; }
table.codes .btn-sm { white-space: nowrap; }

/* ---- Verification ----------------------------------------------------------- */
.badge-bad { background: #FDE8E6; color: #B3261E; }
.license-line { font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.license-line .lic-ok { color: #1D7F4E; font-weight: 600; }
.license-line .lic-bad { color: var(--rose-strong); font-weight: 600; }
.license-line .lic-na { color: var(--muted); font-weight: 600; }
.license-warn { display: block; flex-basis: 100%; color: #7A4B00; font-size: 13px; }
.attest { font-size: 14px; border-radius: 10px; padding: 8px 12px; }
.attest-verified { background: #E3F4EC; color: #1D7F4E; }
.attest-self_attested, .attest-not_verified { background: #FFF4DB; color: #7A4B00; }
.org-table td { font-size: 13px; }
.org-table .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.org-table .reject-note { font: 13px var(--f-body); border: 1.5px solid var(--line); border-radius: 8px; padding: 6px 8px; width: 100%; margin-top: 6px; background: var(--bg); color: var(--text); }
.status-pill { font: 600 12px var(--f-body); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.status-approved { background: #E3F4EC; color: #1D7F4E; }
.status-pending, .status-self_attested { background: #FFF4DB; color: #7A4B00; }
.status-rejected { background: #FDE8E6; color: #B3261E; }

/* ---- Calls, practice phone, staff ------------------------------------------- */
.locked-note { background: #FFF4DB; color: #7A4B00; border-radius: 14px; padding: 14px 16px; font-size: 15px; }
.locked-note a { color: inherit; font-weight: 600; }
.is-locked .scribe-controls, .is-locked #scribe-generate, .is-locked #op-generate, .is-locked .scribe-controls + .session-status { opacity: .45; pointer-events: none; }
.call-panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px; margin-bottom: 16px; }
.call-panel.on-call { border-color: var(--mint); box-shadow: 0 0 0 2px color-mix(in srgb, var(--mint) 35%, transparent); }
.call-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.call-row input { font: 16px var(--f-body); color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; }
.call-row select { width: 100%; }
.call-panel .session-status { margin: 10px 2px 0; }
.btn-danger { background: #B3261E !important; color: #FFFFFF !important; }
#call-unavailable { margin: 0 0 14px; }
.phone-line { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.phone-number { font: 600 20px var(--f-display); color: var(--ink); font-variant-numeric: tabular-nums; }
.phone-code { display: grid; gap: 8px; background: var(--tint); border-radius: 12px; padding: 14px 16px; font-size: 15px; }
.code-digits { font: 700 34px var(--f-mono); letter-spacing: .2em; color: var(--ink); }
.link-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.link-list > li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; background: var(--tint); border-radius: 12px; padding: 10px 14px; }
.link-list > li > div:first-child { display: grid; gap: 2px; min-width: 0; }
.link-list > li.fine { display: block; background: none; padding: 4px 0; }
@media (max-width: 720px) { .call-row { grid-template-columns: 1fr; } .call-btn { justify-self: start; } }
.call-panel .session-status:empty { display: none; }
.code-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.code-input { font: 700 26px var(--f-mono); letter-spacing: .3em; width: 9.5em; max-width: 100%; text-align: center; color: var(--ink); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.code-input:focus { border-color: var(--ink); outline: none; }

/* ---- Legal documents (privacy, terms) --------------------------------------- */
.legal-doc { max-width: 780px; gap: 14px; }
.legal-doc h1 { margin-top: 8px; }
.legal-doc h2 { font-size: 21px; color: var(--ink); margin-top: 18px; }
.legal-doc h3 { font-size: 16px; color: var(--text); margin-top: 6px; }
.legal-doc p, .legal-doc li { font-size: 16px; line-height: 1.65; color: var(--text); }
.legal-doc ul { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.legal-doc a { color: var(--ink); }
.legal-meta { font: 500 13px var(--f-mono); color: var(--muted) !important; }
.legal-links { margin-top: 18px; }
.nowrap { white-space: nowrap; }
.footer-links a, .login-fine a { color: inherit; }

/* Identity verification (profile) */
.id-methods { display: grid; gap: 16px; margin-top: 12px; }
.id-method { display: grid; gap: 8px; justify-items: start; }
.id-method .check { justify-self: stretch; }
.sso-doximity, .dox-btn { color: #0A66C2; }

/* ---- Scribe templates ----------------------------------------------------------- */
.note-options .tpl-field { grid-column: 1 / -1; }
.patient-fields { display: grid; gap: 6px; align-content: start; }
.patient-fields .patient-row-label { font-weight: 600; font-size: 14px; }
#hist-status:empty { display: none; }
.patient-fields .patient-row { flex-wrap: nowrap; }
.patient-row .age-input { width: 90px; flex: none; }
.patient-row select { width: auto; flex: 0 1 140px; min-width: 0; }
.tpl-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tpl-row select { flex: 1 1 260px; min-width: 0; }
.patient-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 10px 0; }
.patient-row-label { font-weight: 600; font-size: 14px; }
.patient-fields .patient-row { margin: 0; }
.age-input { width: 84px; font: 500 15px var(--f-body); color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.age-input:focus { border-color: var(--ink); outline: none; }
.tpl-dialog { width: min(760px, calc(100vw - 32px)); }
.tpl-lib-filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 4px 0 12px; }
.tpl-lib-filters .search { flex: 1 1 260px; max-width: none; }
.tpl-lib-filters select { flex: 0 1 220px; }
.tpl-lib-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; max-height: min(56vh, 520px); overflow-y: auto; }
.tpl-lib-list > li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--surface); }
.tpl-lib-list > li > div { display: grid; gap: 3px; min-width: 0; }
.tpl-lib-list details summary { cursor: pointer; font-size: 13px; color: var(--muted); }
.tpl-lib-list .btn { flex: none; }
.tpl-lib-list .empty { justify-content: center; color: var(--muted); }

/* ---- Visit history ---------------------------------------------------------------- */
.hist-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.hist-bar .fine { flex: 1 1 260px; }
.hist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.hist-list .empty { color: var(--muted); padding: 16px 4px; }
.hist-day { display: flex; align-items: baseline; gap: 10px; padding: 14px 4px 2px; }
.hist-day:first-child { padding-top: 2px; }
.hist-day h3 { margin: 0; font-size: 15px; color: var(--ink); }
.hist-patient { font-size: 14px; font-weight: 600; color: var(--ink); margin: 0; overflow-wrap: anywhere; }
.hist-row { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 16px; }
.hist-row:hover { border-color: var(--ink); }
.hist-flag { display: grid; justify-items: center; gap: 2px; flex: none; width: 64px; }
.hist-flag img { width: 36px; height: 27px; border-radius: 4px; box-shadow: 0 0 0 1px rgba(19, 49, 92, .14); object-fit: cover; }
.hist-icon { width: 26px; height: 26px; color: var(--muted); }
.hist-lang { font-size: 12px; color: var(--muted); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-text-col { display: grid; gap: 3px; min-width: 0; }
.hist-text-col b { font-weight: 600; line-height: 1.35; }
.hist-text-col .muted { color: var(--muted); font-weight: 500; }
.hist-detail { display: grid; gap: 14px; }
.hist-detail-head { display: flex; gap: 14px; align-items: flex-start; }
.hist-detail-head h2 { font-size: 20px; color: var(--ink); line-height: 1.3; }
.hist-transcript summary { cursor: pointer; font-weight: 600; margin-bottom: 8px; }
.hist-text { white-space: pre-wrap; font: 14px/1.5 var(--f-body); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px; max-height: 420px; overflow: auto; }
.hist-delete { justify-self: start; color: #B3261E; }
.hist-row .badge { flex: none; margin-left: auto; }
.hist-row.needs-note { border-color: #B26B00; }
.panel-inset { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 12px; background: var(--bg); }
.panel-inset h3, .note-editor h3 { font-size: 16px; color: var(--ink); margin: 0; }
.note-editor { display: grid; gap: 12px; }
.note-section { display: grid; gap: 6px; border-left: 3px solid var(--line); padding-left: 12px; }
.note-section h4 { margin: 0; font-size: 15px; color: var(--ink); }
.section-box { min-height: 0; font-family: var(--f-body); }
.section-add { display: flex; gap: 8px; flex-wrap: wrap; }
.section-add-input { flex: 1 1 220px; min-width: 0; font: 15px var(--f-body); color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.section-add-input:focus { border-color: var(--ink); outline: none; }
.section-mic { display: inline-flex; align-items: center; gap: 6px; }
.section-mic svg { width: 16px; height: 16px; }
.section-mic.is-recording { background: #B3261E; color: #FFFFFF; border-color: #B3261E; }
.section-status:empty { display: none; }
#session-history-note a { color: var(--ink); }

/* ---- Locations, signature, fax, live draft ------------------------------------------ */
.loc-add > summary { list-style: none; display: inline-flex; cursor: pointer; }
.loc-add > summary::-webkit-details-marker { display: none; }
.loc-form { display: grid; gap: 12px; margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--bg); }
.loc-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.loc-row > .field, .loc-row > input:first-child { flex: 1 1 200px; min-width: 0; }
.loc-row input, .loc-npi input, .loc-form .field input, #fax-form .field input {
  font: 15px var(--f-body); color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; }
.loc-row .loc-state { width: 76px; flex: none; }
.loc-npi { display: grid; gap: 6px; }
.loc-npi label { font-weight: 600; font-size: 14px; }
.loc-address-field { position: relative; }
.addr-suggest { list-style: none; margin: 4px 0 0; padding: 4px; position: absolute; z-index: 5; left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.addr-suggest button { width: 100%; text-align: left; display: grid; gap: 2px; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.addr-suggest button:hover { background: var(--tint); }
.addr-suggest small { color: var(--muted); }
.sig-draw { display: grid; gap: 8px; margin: 8px 0; }
#sig-canvas { width: 100%; max-width: 600px; height: auto; aspect-ratio: 600 / 160; background: #FFFFFF; border: 1.5px dashed var(--line); border-radius: 12px; touch-action: none; cursor: crosshair; }
.sig-image { max-width: 220px; max-height: 70px; background: #FFFFFF; border-radius: 6px; padding: 4px; }
.fax-list { margin-top: 4px; }
.rough { border: 1px dashed var(--line); border-radius: 14px; padding: 10px 14px; background: var(--surface); }
.rough summary { cursor: pointer; font-weight: 600; }
.rough-text { white-space: pre-wrap; font: 13.5px/1.5 var(--f-body); color: var(--muted); max-height: 320px; overflow: auto; margin: 8px 0; }

/* ---- Sign-up: provider or staff, NPI search ---------------------------------- */
.role-pick { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.role-pick legend { font-weight: 600; font-size: 14px; margin-bottom: 8px; padding: 0; }
.role-card { display: flex; gap: 10px; align-items: flex-start; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; background: var(--bg); }
.role-card input { margin-top: 3px; accent-color: var(--ink); }
.role-card span { display: grid; gap: 3px; }
.role-card small { font-size: 13px; color: var(--muted); line-height: 1.35; }
.role-card:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 15%, transparent); }
.npi-signup { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--tint); }
.npi-signup-h { display: grid; gap: 2px; font-size: 15px; margin: 0; }
.npi-signup-h span { font-size: 13px; color: var(--muted); }
.npi-signup-row { grid-template-columns: minmax(0, 1fr) 120px auto; align-items: end; gap: 10px; }
.login-form .npi-signup-row .btn, .login-form .npi-picked .btn { width: auto; flex: none; }
.login-form .npi-signup ul.npi-results { padding: 0; margin: 8px 0 0; }
.login-form .npi-signup ul.npi-results > li { display: block; padding: 0; border: 0; background: none; }
.npi-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 260px; overflow-y: auto; }
.npi-results button { width: 100%; text-align: left; font: inherit; color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; display: grid; gap: 2px; }
.npi-results button:hover { border-color: var(--ink); }
.npi-results small, .npi-picked span { font-size: 13px; color: var(--muted); }
.npi-picked { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--surface); border: 1.5px solid var(--ink); border-radius: 12px; padding: 10px 12px; }
.npi-picked > div { display: grid; gap: 2px; min-width: 0; }
@media (max-width: 480px) {
  .role-pick { grid-template-columns: 1fr; }
  .npi-signup-row { grid-template-columns: 1fr 1fr; }
  .login-form .npi-signup-row .btn { grid-column: span 2; width: 100%; }
}

.signup-staff #identity-panel { display: none !important; }
.prof-provider-toggle { margin: 0 0 4px; }

/* ---- Touch Mode --------------------------------------------------------------
   Big, easy-to-tap layout for tablets and touch screens: all languages as large tiles plus a
   Scribe button; menus, search and the reference panel are tucked away. */

.touch-toggle { display: inline-flex; align-items: center; gap: 8px; }
.touch-toggle svg { width: 18px; height: 18px; flex: none; }
.touch-toggle[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
body:not(.touch-mode) .touch-only { display: none !important; }

.touch-mode .mode-nav, .touch-mode .specialty-picker, .touch-mode .user-name, .touch-mode #sign-out,
.touch-mode .ref, .touch-mode #view-languages .view-sub,
.touch-mode #view-languages > .fine, .touch-mode .type-row { display: none !important; }
.touch-mode .app-shell { grid-template-columns: 1fr; max-width: 1280px; padding-block: 20px 40px; }
.touch-mode .touch-toggle { min-height: 52px; padding: 12px 20px; font-size: 16px; }
.touch-mode .touch-toggle svg { width: 22px; height: 22px; }
.touch-mode button, .touch-mode a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }

/* Languages */
.touch-mode .view-head { margin-bottom: 16px; gap: 12px; }
.touch-mode .provider-lang { font-size: 16px; }
.touch-mode .provider-lang select { font-size: 18px; min-height: 56px; padding: 12px 44px 12px 16px; }
.touch-mode .touch-scribe {
  display: flex; align-items: center; gap: 20px; min-height: 116px; padding: 22px 28px; margin-bottom: 16px;
  border-radius: 22px; background: #0F6E63; color: #FFFFFF; text-decoration: none;
  transition: transform .12s ease, box-shadow .2s ease;
}
.touch-mode .touch-scribe:active { transform: scale(.985); }
.touch-mode .touch-scribe svg { width: 52px; height: 52px; flex: none; }
.touch-scribe-text { display: grid; gap: 4px; }
.touch-scribe-text b { font: 700 clamp(26px, 3.2vw, 34px)/1.15 var(--f-display); letter-spacing: -.02em; }
.touch-scribe-text span { font-size: 17px; opacity: .92; }
.touch-mode .lang-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.touch-mode .lang-card { min-height: 112px; padding: 18px 20px; align-content: center; gap: 6px; border-width: 2px; border-radius: 20px; }
.touch-mode .lang-card:active { transform: scale(.97); border-color: var(--rose); background: var(--blush); }
.touch-mode .lang-native { font-size: 28px; }
.touch-mode .lang-flags { gap: 8px; min-height: 30px; margin-bottom: 4px; }
.touch-mode .lang-flags img { width: 40px; height: 30px; border-radius: 4px; }
.touch-mode .lang-name { font-size: 16px; color: var(--muted); }
.touch-mode .lang-region, .touch-mode .lang-meter, .touch-mode .lang-count { display: none; }

/* Interpreter session */
.touch-mode #back, .touch-mode .touch-back {
  display: inline-flex; align-items: center; gap: 6px; width: auto; height: 60px; padding: 0 22px 0 14px;
  font: 600 17px var(--f-body); color: var(--text); text-decoration: none;
}
.touch-mode #back svg, .touch-mode .touch-back svg { width: 26px; height: 26px; }
.touch-mode .talk-row { gap: 18px; }
.touch-mode .talk { min-height: min(46vh, 440px); border-radius: 28px; }
.touch-mode .talk:active:not(:disabled) { transform: scale(.985); }
.touch-mode .talk svg { width: 64px; height: 64px; }
.touch-mode .talk-who { font-size: 14px; }
.touch-mode .talk-lang { font-size: clamp(30px, 4vw, 44px); }
.touch-mode .talk-hint { font-size: 18px; }
.touch-mode #view-session .session-status { font-size: 18px; text-align: center; }
.touch-mode #session-note-open { min-height: 56px; padding: 14px 22px; font-size: 16px; }

/* Scribe */
.touch-mode .touch-back { justify-self: start; }
.touch-mode .rec-btn { min-height: 88px; padding: 24px 40px; font-size: 22px; }
.touch-mode .rec-dot { width: 20px; height: 20px; }
.touch-mode .rec-time { font-size: 18px; }
.touch-mode .scribe-controls .btn, .touch-mode #scribe-generate { min-height: 60px; padding: 14px 24px; font-size: 17px; }
.touch-mode #scribe-status { font-size: 17px; }

@media (max-width: 640px) {
  .touch-mode .touch-toggle { min-height: 48px; padding: 10px 14px; }
  .touch-mode .lang-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .touch-mode .lang-card { min-height: 96px; padding: 14px 16px; }
  .touch-mode .lang-native { font-size: 23px; }
  .touch-mode .touch-scribe { min-height: 96px; padding: 18px 20px; gap: 14px; }
  .touch-mode .touch-scribe svg { width: 40px; height: 40px; }
  .touch-mode .talk { min-height: 30vh; }
  .touch-mode .rec-btn { width: 100%; justify-content: center; }
}

/* Conflicting details to pick (A.choices) */
.choices { display: grid; gap: 8px; }
.choices:empty { display: none; }
.choices .choice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 10px 12px; border-radius: 12px; background: #FFF4DB; color: #7A4B00; font-size: 14px; }
.choices .choice-label { flex: 1 1 100%; }
.choices .choice-label q { color: inherit; }
.choices .choice-btn { background: #fff; color: #5C3900; border: 1px solid #E8C77A; min-height: 36px; }
.choices .choice-btn:hover, .choices .choice-btn:focus-visible { background: #FFE7B0; }
.choices .choice-suggest { background: #E8F1FB; color: #1F4A78; }
.choices .choice-suggest .choice-btn { color: #1F4A78; border-color: #A9C6E8; }
.choices .choice-suggest .choice-btn:hover, .choices .choice-suggest .choice-btn:focus-visible { background: #D3E4F7; }
.choices .choice-suggest .choice-skip { background: transparent; border-style: dashed; }
.note-section.has-choice .section-box { border-color: #E8C77A; }
#op-choices { margin-top: 10px; }

/* Location note header */
.loc-header { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px 12px; margin: 4px 0 12px; display: grid; gap: 8px; min-width: 0; }
.loc-header legend { padding: 0 6px; font-weight: 600; font-size: 14px; }
.loc-header textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; width: 100%; }
.loc-header-preview { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--tint, #f6f7f9); white-space: pre-wrap; word-break: break-word; font: 13px/1.5 var(--f-body, sans-serif); }
.linklike { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }

/* Referring provider */
.ref-field .tpl-row { align-items: center; }
.ref-current { flex: 1 1 auto; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
#ref-dialog .loc-form { margin-top: 10px; }

/* NPI searches: one name box, a state menu, an optional ZIP */
.loc-row select.loc-state { width: 150px; flex: none; }
.loc-row .loc-zip { width: 96px; flex: none; }
.npi-search select, .loc-row select { font: 15px var(--f-body); color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; padding: 9px 10px; min-width: 0; }

/* ICD-10-CM diagnoses (diagnoses.js) */
.dx-panel { min-width: 0; display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); margin: 6px 0 14px; }
.dx-panel h4 { margin: 0; font-size: 15px; color: var(--ink); }
.dx-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; counter-reset: dx; }
.dx-item { min-width: 0; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 8px; background: var(--bg); counter-increment: dx; }
.dx-item.dx-primary { border-color: var(--ink); }
.dx-item.dx-warn { border-color: #E8C77A; background: #FFFBF0; }
.dx-main { display: grid; gap: 3px; min-width: 0; }
.dx-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.dx-top::before { content: counter(dx) "."; color: var(--muted); font-size: 14px; }
.dx-item.in-group { counter-increment: none; margin-left: 18px; border-left: 3px solid var(--ink); }
.dx-item.in-group .dx-top::before { content: "•"; }
.dx-group-head { counter-increment: dx; display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.dx-group-head::before { content: counter(dx) "."; color: var(--muted); font-size: 14px; }
.dx-group-name { flex: 1 1 auto; min-width: 0; font: 600 15px var(--f-body); color: var(--ink); background: transparent; border: 1.5px dashed var(--line); border-radius: 10px; padding: 6px 10px; }
.dx-row { display: flex; gap: 8px; align-items: flex-start; }
.dx-handle { flex: none; width: 32px; min-height: 40px; border: 0; border-radius: 8px; background: var(--tint); color: var(--muted); font-size: 18px; cursor: grab; touch-action: none; }
.dx-handle:active { cursor: grabbing; }
.dx-dragging { opacity: 0.35; }
.dx-ghost { position: fixed; z-index: 50; pointer-events: none; box-shadow: var(--shadow); opacity: 0.95; background: var(--surface); }
.dx-drop-before { box-shadow: 0 -3px 0 0 var(--ink); }
.dx-drop-after { box-shadow: 0 3px 0 0 var(--ink); }
.dx-drop-group { outline: 2px dashed var(--ink); outline-offset: 2px; background: var(--tint); }
.dx-code { font: 600 13px ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--tint); color: var(--ink); border-radius: 8px; padding: 2px 7px; white-space: nowrap; }
.dx-evidence { font-style: italic; }
.dx-alert { font-size: 13px; color: #7A4B00; font-weight: 600; }
.dx-hint { font-size: 13px; color: #1F4A78; }
.dx-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.dx-search { position: relative; display: grid; gap: 6px; }
.dx-search input { font: 15px var(--f-body); color: var(--text); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; width: 100%; }
.dx-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; max-height: 300px; overflow-y: auto; }
.dx-results button { width: 100%; text-align: left; display: flex; gap: 8px; align-items: baseline; font: 14px var(--f-body); color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; }
.dx-results button:hover, .dx-results button:focus-visible { border-color: var(--ink); }
.dx-results .empty { font-size: 13px; color: var(--muted); padding: 4px 2px; }
.note-section.managed .section-box { background: var(--tint); }

/* Final note preview */
.preview-dialog .note-dialog-inner { max-width: 760px; }
.preview-page { background: #fff; color: #141414; border: 1px solid var(--line); border-radius: 10px; padding: 24px 26px; font: 15px/1.55 var(--f-body); box-shadow: var(--shadow); max-height: 62vh; overflow-y: auto; }
.preview-page h3 { font-size: 15px; margin: 16px 0 4px; color: #141414; }
.preview-page h3:first-child { margin-top: 0; }
.preview-page p { margin: 0 0 6px; }
.preview-page ul, .preview-page ol { margin: 0 0 6px; padding-left: 22px; }
.preview-letterhead { font-weight: 700; font-size: 17px; }
.preview-headerline { color: #555; font-size: 13px; margin: 0 !important; }
.preview-headerline:last-of-type { margin-bottom: 12px !important; }
.preview-page .sig-image { max-height: 70px; display: block; margin: 4px 0; }
.preview-alert { background: #FFF4DB; color: #7A4B00; border-radius: 10px; padding: 10px 12px; font-size: 14px; }
.preview-checklist { font-size: 14px; border: 1px dashed var(--line); border-radius: 10px; padding: 8px 12px; }
.preview-checklist summary { cursor: pointer; font-weight: 600; }
@media (max-width: 480px) { .preview-page { padding: 16px; } }

/* Billing codes */
.bill-panel { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.bill-panel h4 { margin: 0; font-size: 15px; color: var(--ink); }
.bill-list .dx-item { counter-increment: none; }
.bill-list .dx-top::before { content: none; }
.bill-mods, .bill-dx { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mod-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--tint); color: var(--ink); border-radius: 999px; padding: 3px 4px 3px 10px; font: 600 13px var(--f-body); }
.mod-chip small { font-weight: 400; color: var(--muted); max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mod-chip button { border: 0; background: none; color: var(--muted); font-size: 16px; line-height: 1; padding: 2px 6px; cursor: pointer; border-radius: 999px; }
.mod-chip.mod-bad { background: #FDE8E6; color: #B3261E; }
.bill-mods select { font: 13px var(--f-body); border: 1.5px dashed var(--line); border-radius: 999px; padding: 4px 8px; background: var(--surface); color: var(--text); width: 132px; min-width: 0; }
.bill-units { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.bill-units input { width: 56px; font: 14px var(--f-body); border: 1.5px solid var(--line); border-radius: 8px; padding: 3px 6px; }
.dx-chip { font: 600 12px ui-monospace, SFMono-Regular, Menlo, monospace; border: 1.5px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 8px; padding: 4px 8px; cursor: pointer; }
.dx-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.bill-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bill-add label { font-size: 14px; font-weight: 600; }
.bill-add input { width: 130px; font: 15px var(--f-body); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; text-transform: uppercase; }

/* Optional sections bar */
.sec-bar { border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px 12px; margin: 4px 0 12px; display: grid; gap: 8px; min-width: 0; }
.sec-bar legend { padding: 0 6px; font-weight: 600; font-size: 14px; }
.sec-toggles { display: flex; flex-wrap: wrap; gap: 8px; }
.sec-toggle { display: flex; align-items: flex-start; gap: 8px; border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; cursor: pointer; background: var(--bg); font-size: 14px; flex: 1 1 200px; }
.sec-toggle:has(input:checked) { border-color: var(--ink); }
.sec-toggle input { width: 18px; height: 18px; margin-top: 1px; accent-color: #13315C; flex: none; }
.sec-toggle span { display: grid; gap: 1px; font-weight: 600; }
.sec-toggle small { font-weight: 400; color: var(--muted); font-size: 12px; }

/* E&M: assessment and plan per diagnosis */
.dx-ap { display: grid; gap: 6px; width: 100%; }
.dx-ap label { display: grid; gap: 3px; font-size: 13px; font-weight: 600; color: var(--muted); }
.dx-ap textarea { font: 14px/1.45 var(--f-body); color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 10px; padding: 8px 10px; width: 100%; resize: vertical; }
.dx-group-head { flex-wrap: wrap; }
.dx-general { display: grid; gap: 4px; counter-increment: dx; border: 1.5px dashed var(--line); border-radius: 12px; padding: 10px 12px; }
.dx-general::before { content: none; }
.sec-toggle.required { opacity: 0.85; cursor: default; }

/* Bundled codes */
.bundle-badge { font-size: 11px; padding: 3px 8px; white-space: normal; }
.bundle-not-billable { background: #EEF0F3; color: #3D4654; }
.bundle-needs-modifier { background: #FFF4DB; color: #7A4B00; }
.bundle-unbundled { background: #E3F4EC; color: #1D7F4E; }
.bill-item.bill-bundled { background: var(--tint); }
.code-cell .bundle-badge { display: inline-block; margin-top: 4px; }

/* Proposed groups */
.dx-proposals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.dx-proposal { display: grid; gap: 8px; border: 1.5px dashed var(--ink); border-radius: 12px; padding: 10px 12px; background: var(--tint); }
.dx-proposal > div:first-child { display: grid; gap: 2px; min-width: 0; }

/* ==== Provider UX pass ======================================================== */

/* Full width where the specialty reference doesn't help. */
body[data-view="view-history"] .app-shell, body[data-view="view-profile"] .app-shell, body[data-view="view-opnote"] .app-shell { grid-template-columns: minmax(0, 1fr); max-width: 1040px; }
body[data-view="view-history"] .ref, body[data-view="view-profile"] .ref, body[data-view="view-opnote"] .ref { display: none; }

/* Nav badge: notes waiting for a signature. */
.nav-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px; border-radius: 999px; background: var(--accent, #E05A47); color: #fff; font: 700 11px var(--f-body); vertical-align: 1px; }
.baa-link { text-decoration: none; }

/* Numbered steps */
.step-h { display: flex; align-items: center; gap: 10px; font-size: 18px; color: var(--ink); margin: 18px 0 10px; }
.step-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 999px; background: var(--ink); color: #fff; font: 700 13px var(--f-body); flex: none; }
.scribe-setup { margin: 4px 0 6px; }
.scribe-setup .step-h { margin-top: 0; }
.btn-lg { font-size: 17px; padding: 14px 26px; }

/* Compact header on phones: one row for brand and account, the specialty, then all five tabs. */
@media (max-width: 640px) {
  .app-header-inner { row-gap: 8px; }
  .user-menu { gap: 6px; }
  .user-menu .btn { padding: 6px 10px; font-size: 13px; }
  .touch-toggle span { display: none; }
  .mode-nav { overflow: visible; }
  .mode-nav a { flex: 1 1 0; min-width: 0; padding: 8px 2px; font-size: 12.5px; text-align: center; white-space: nowrap; }
  .nav-badge { margin-left: 3px; min-width: 16px; height: 16px; font-size: 10px; }
  .trial-banner, .baa-banner { padding: 8px 14px; gap: 8px; font-size: 13px; flex-direction: row; flex-wrap: nowrap; text-align: left; justify-content: space-between; }
  .trial-banner p, .baa-banner p { flex: 1 1 auto; min-width: 0; }
  .trial-banner .btn, .baa-banner .btn { padding: 6px 10px; font-size: 12.5px; flex: none; }
  .view-sub { font-size: 15px; }
}

/* Menus (details/summary): Sections, Rewrite, Suggest, More, the visit's ⋯ */
.tool-menu { position: relative; }
.tool-menu > summary { list-style: none; cursor: pointer; font: 600 13px var(--f-body); color: var(--ink); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--surface); user-select: none; white-space: nowrap; }
.tool-menu > summary::-webkit-details-marker { display: none; }
.tool-menu > summary::after { content: " ▾"; font-size: 11px; color: var(--muted); }
.tool-menu[open] > summary { border-color: var(--ink); }
.visit-menu > summary { font-size: 18px; line-height: 1; padding: 6px 12px 10px; }
.visit-menu > summary::after { content: none; }
.menu-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 200px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; }
.menu-pop.menu-right { left: auto; right: 0; }
.menu-pop.wide { width: min(560px, calc(100vw - 32px)); padding: 12px; }
.menu-pop > button { text-align: left; font: 14px var(--f-body); color: var(--text); background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; }
.menu-pop > button:hover, .menu-pop > button:focus-visible { background: var(--tint); }
.menu-pop > button.danger, .danger-link { color: #B3261E; }
.menu-pop .sec-bar { border: 0; padding: 0; margin: 0; }
.menu-pop .panel-inset { margin: 0; border: 0; padding: 0; background: none; }
.tool-row { display: flex; gap: 8px; flex-wrap: wrap; }
.dx-more > summary { font-size: 17px; line-height: 1; padding: 5px 11px 9px; }
.dx-more > summary::after { content: none; }

/* Visit header and facts */
.hist-detail-head { align-items: flex-start; }
.hist-d-title { flex: 1 1 auto; min-width: 0; }
.hist-d-title h2 { font-size: clamp(18px, 2.4vw, 22px); line-height: 1.3; }
.visit-facts { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; margin: 10px 0 4px; }
.visit-facts .patient-row { margin: 0; }
.ref-slot .ref-field { margin: 0; }
.ref-slot:empty { display: none; }
.rewrite-warn { font-size: 13px; color: #7A4B00; background: #FFF4DB; border-radius: 8px; padding: 8px 10px; margin: 0; }

/* Before you sign */
.review { border: 1.5px solid var(--ink); border-radius: 14px; padding: 12px 14px; margin: 6px 0 14px; background: var(--surface); }
.review h3 { margin: 0 0 6px; font-size: 15px; color: var(--ink); }
.review-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.review-list > li { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-left: 18px; position: relative; }
.review-list > li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px; border-radius: 999px; background: var(--muted); }
.review-list > li.review-block::before { background: #B3261E; }
.review-list > li.review-todo::before { background: #E0A100; }
.review-list > li.review-info::before { background: #8A94A6; }
.review-list > li.review-verify { display: grid; }
.review-list > li.review-verify::before { background: #1F4A78; }
.review-list ul { margin: 2px 0 0; padding-left: 18px; color: var(--text); }
.flash { animation: flash 1.6s ease-out; }
@keyframes flash { 0%, 30% { box-shadow: 0 0 0 4px color-mix(in srgb, #E0A100 55%, transparent); } 100% { box-shadow: none; } }

/* Note sections */
.step-head { align-items: center; margin-top: 4px; }
.step-head .step-h { margin: 0; }
.note-warning { font-size: 13px; padding: 8px 12px; }
.note-section { margin-bottom: 14px; }
.note-section .fine-h { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.note-section.note-header .section-box { font-size: 13px; color: var(--muted); background: var(--tint); }
.section-add-toggle { font-size: 13px; color: var(--muted); justify-self: start; padding: 2px 0; text-decoration: none; }
.section-add-toggle:hover { color: var(--ink); text-decoration: underline; }
.managed-preview { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--tint); font: 13px/1.5 var(--f-body); white-space: pre-wrap; word-break: break-word; }
.note-section.dx-slot { border-left: 0; padding-left: 0; }
.note-section.dx-slot .dx-panel { margin: 0; }

/* Sign and send */
.sign-block { display: grid; gap: 10px; margin-bottom: 8px; }

/* Bottom action bar while a note is open */
.action-bar { position: sticky; bottom: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 16px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: 16px 16px 0 0; box-shadow: 0 -6px 18px rgba(19, 49, 92, .08); }
.ab-status { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; font-weight: 600; font-size: 15px; }
.ab-status .ab-todo { color: #7A4B00; }
.ab-status .ab-ready { color: #1D7F4E; }
.ab-status .ab-signed { color: #1D7F4E; }
.ab-status .fine { font-weight: 400; }
.ab-buttons { display: flex; gap: 8px; }
.ab-buttons .btn { min-width: 96px; }
#hist-final:disabled { opacity: 1; background: #1D7F4E; border-color: #1D7F4E; }
@media (max-width: 640px) {
  .action-bar { margin-inline: -16px; border-radius: 0; padding-inline: 16px; }
  .ab-buttons { flex: 1 1 100%; }
  .ab-buttons .btn { flex: 1; }
}

/* Visits list: filters and status */
.hist-filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.hist-filters .filter-chip { font: 600 14px var(--f-body); color: var(--muted); background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 14px; cursor: pointer; }
.hist-filters .filter-chip[aria-pressed="true"] { color: #fff; background: var(--ink); border-color: var(--ink); }
.chip-n { font-weight: 400; opacity: .8; margin-left: 2px; }
.badge-todo { background: #E8F1FB; color: #1F4A78; }
.hist-row .badge { flex: none; white-space: nowrap; }
.hist-bar { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; }
.hist-bar .fine { flex: 1 1 320px; }
.danger-link { font-size: 13px; }
.in-visit .view-head { display: none; }
.visit-facts .patient-row { flex-wrap: nowrap; }
.visit-facts .patient-row select { width: auto; min-width: 110px; }
.visit-facts .ref-field { display: grid; gap: 2px; }
@media (max-width: 640px) {
  .hist-detail-head { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 8px 10px; }
  .hist-detail-head .hist-d-title { grid-column: 1 / -1; grid-row: 2; }
  .hist-detail-head .visit-menu { grid-column: 4; grid-row: 1; justify-self: end; }
  .hist-d-title h2 { font-size: 19px; }
  .hist-flag { flex-direction: row; gap: 6px; }
}
@media (max-width: 640px) {
  .hist-row { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; row-gap: 6px; padding: 12px; }
  .hist-row .hist-flag { width: 48px; grid-row: span 2; align-self: start; }
  .hist-row .badge { grid-column: 2; justify-self: start; }
  .hist-text-col b { font-size: 15px; }
}

/* Profile quick links */
.prof-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.prof-jump button { font: 600 13px var(--f-body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.prof-jump button:hover { border-color: var(--ink); }
#view-profile .panel, #prof-linked { scroll-margin-top: 16px; }

/* Section heading line: the heading, + Add and the microphone */
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 36px; }
.sec-head h4 { margin: 0; min-width: 0; }
.sec-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.sec-btn { font: 600 13px var(--f-body); color: var(--ink); background: var(--surface); border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 11px; cursor: pointer; white-space: nowrap; }
.sec-btn:hover, .sec-btn[aria-expanded="true"] { border-color: var(--ink); }
.section-box.autosize, .dx-ap textarea.autosize, #hist-pt-text.autosize { resize: none; overflow: hidden; }
#hist-pt-text { font-family: var(--f-body); font-size: 15px; line-height: 1.5; }
details.note-section > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: flex-start; gap: 10px; }
details.note-section > summary::-webkit-details-marker { display: none; }
details.note-section > summary::after { content: "Show ▾"; margin-left: auto; flex: none; font: 600 12px var(--f-body); color: var(--muted); }
details.note-section[open] > summary::after { content: "Hide ▴"; }
details.note-section > summary h4 { flex: none; }
.sec-peek { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.note-section[open] .sec-peek { visibility: hidden; }
details.note-section[open] > summary { margin-bottom: 6px; }
.section-mic-quick { width: 36px; height: 36px; flex: none; }
.section-mic-quick svg { width: 18px; height: 18px; }
.section-mic-quick.is-recording { background: #E05A47; border-color: #E05A47; color: #fff; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, #E05A47 25%, transparent); } }

/* The patient's visit summary */
.pt-summary { display: grid; gap: 8px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; background: var(--surface); }
.pt-summary h3 { margin: 0; font-size: 15px; color: var(--ink); }
.pt-lang select { font: 14px var(--f-body); border: 1.5px solid var(--line); border-radius: 10px; padding: 6px 8px; max-width: 200px; }
/* On phones the larger menus (Sections, Rewrite) open as a sheet from the bottom of the screen. */
@media (max-width: 640px) {
  .menu-pop.wide { position: fixed; left: 12px; right: 12px; top: auto; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 72vh; overflow-y: auto; z-index: 60; box-shadow: 0 -8px 30px rgba(19, 49, 92, .25); }
  .sec-toggle { flex-basis: 100%; }
}
.pt-summary .note-out-head { flex-wrap: wrap; gap: 8px; }

/* ==== Note editor: compact, document-like editing ============================== */

/* Scrolling to something lands below the app's sticky header (its height is measured by app.js). */
html { scroll-padding-top: calc(var(--sticky-top, 72px) + 8px); }

/* Long one-line content (the jump bar, folded previews) must never widen the page. */
.hist-detail, .note-editor, .note-section { grid-template-columns: minmax(0, 1fr); }
.note-jump, details.note-section > summary { min-width: 0; }

/* Jump bar: every part of the note one tap away, stuck to the top of the screen. */
.note-jump { position: sticky; top: var(--sticky-top, 0px); z-index: 25; display: flex; align-items: center; gap: 8px;
  margin: -6px -22px 0; padding: 7px 22px; background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); transition: opacity .15s, transform .15s; }
.jump-back { width: 34px; height: 34px; border-radius: 10px; }
.jump-back svg { width: 18px; height: 18px; }
.jump-list { display: flex; gap: 6px; overflow-x: auto; flex: 1 1 auto; min-width: 0; scrollbar-width: none; padding: 2px 0; }
.jump-list::-webkit-scrollbar { display: none; }
.jump-chip { position: relative; flex: none; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 600 13px var(--f-body); color: var(--muted);
  background: var(--tint); border: 1.5px solid transparent; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.jump-chip:hover { border-color: var(--line); color: var(--ink); }
.jump-chip[aria-current] { background: var(--ink); color: var(--surface); }
.jump-chip.needs::after { content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: #E0A100; }
.jump-n { margin-left: 5px; font-weight: 400; opacity: .75; }
.note-section, #hist-dx, #hist-step-bill, #hist-step-sign, #hist-review, .dx-item { scroll-margin-top: 52px; }
.dx-item, .note-section { scroll-margin-bottom: 96px; }

/* Before you sign: Close only shows when it's a sheet (phones). */
.review-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.review-close { display: none; font-size: 14px; }
.ab-review { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.ab-review:disabled { cursor: default; }

/* Diagnoses: the code is the "change" button; ⋯ in the corner; one line of detail. */
.dx-row > .dx-main { flex: 1 1 auto; }
.dx-row > .dx-more { flex: none; margin-left: auto; }
.dx-code-btn { border: 1.5px solid transparent; cursor: pointer; }
.dx-code-btn::after { content: " ▾"; font-size: 10px; color: var(--muted); }
.dx-code-btn:hover, .dx-code-btn:focus-visible { border-color: var(--ink); }
.dx-desc { line-height: 1.4; }
.dx-ap .ap-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 8px; align-items: start; font-weight: 600; }
.dx-ap .ap-l { padding-top: 9px; font-size: 13px; color: var(--muted); }
.ap-short { display: none; }
.bill-item { position: relative; padding-right: 52px; }
.bill-item > .dx-actions { position: absolute; top: 8px; right: 8px; }

@media (max-width: 640px) {
  /* In an open visit the app's header scrolls away; the jump bar (with Back) takes its place. */
  body.in-visit[data-view="view-history"] .app-header { position: static; }
  body.in-visit[data-view="view-history"] .app-shell { padding-top: 12px; }

  /* The open visit uses the phone's full width. */
  #view-history.in-visit .hist-detail { margin-inline: -20px; border-radius: 0; border-inline: 0; padding: 12px 12px 16px; gap: 8px; }
  .note-jump { margin: -4px -12px 0; padding: 6px 12px; }
  .hist-d-title h2 { font-size: 17px; line-height: 1.3; }
  #hist-d-meta { font-size: 12.5px; }
  .visit-facts { gap: 6px 16px; margin: 0; }
  .visit-facts .ref-field { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
  .visit-facts .ref-field .tpl-row { flex: 1 1 auto; }
  .hist-transcript > summary { padding-block: 4px; }
  .note-editor { gap: 8px; }
  .step-h { font-size: 16px; margin: 14px 0 6px; }
  .step-n { width: 22px; height: 22px; font-size: 12px; }
  .note-warning { font-size: 12.5px; padding: 6px 10px; line-height: 1.4; }

  /* Sections read like the note: the heading line holds the tools, the text runs edge to edge. */
  .note-section { margin: 0; padding: 4px 0 10px; border-left: 0; border-bottom: 1px solid var(--line); gap: 4px; }
  .sec-head { min-height: 34px; }
  .sec-head h4, details.note-section > summary h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--ink); }
  .sec-btn { padding: 5px 10px; }
  .section-mic-quick { width: 34px; height: 34px; border-radius: 10px; }
  .section-mic-quick svg { width: 17px; height: 17px; }
  /* 16px text: iPhones zoom the page into anything smaller when it's tapped. */
  .section-box, .note-section.note-header .section-box { font-size: 16px; line-height: 1.45; padding: 6px 8px; border-radius: 8px; border-color: transparent; background: var(--tint); }
  .note-section.note-header .section-box { font-size: 16px; }
  .section-box:focus { background: var(--surface); border-color: var(--ink); }
  .section-add-input, .dx-search input, .dx-change-q, .bill-add input, #hist-pt-text, .dx-group-name { font-size: 16px; }
  .section-add { gap: 6px; }
  .section-status:empty { display: none; }
  .note-section.dx-slot { border-bottom: 0; padding: 0; }

  /* Diagnoses: tighter cards, A and P labels beside the text. */
  .dx-panel { border: 0; padding: 4px 0 0; background: none; margin: 0; gap: 6px; }
  .dx-list { gap: 6px; }
  .dx-item { padding: 8px 8px 8px 6px; gap: 6px; border-radius: 10px; }
  .dx-item.in-group { margin-left: 10px; }
  .dx-row { gap: 4px; }
  .dx-handle { width: 26px; min-height: 34px; font-size: 16px; background: none; }
  .dx-main { gap: 2px; }
  .dx-top { gap: 4px 6px; font-size: 15px; }
  .dx-top b { line-height: 1.3; }
  .dx-top .badge { padding: 3px 8px; font-size: 11px; }
  .dx-desc, .dx-hint, .dx-alert { font-size: 12.5px; }
  .dx-more > summary { padding: 4px 10px 8px; }
  .dx-actions { padding-left: 30px; gap: 6px; }
  .dx-actions .btn-sm, .dx-group-head .btn-sm { padding: 6px 11px; font-size: 13px; min-height: 0; }
  .dx-panel h4 { font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
  .dx-ap { padding-left: 2px; gap: 4px; }
  .dx-ap .ap-row { grid-template-columns: 16px minmax(0, 1fr); gap: 6px; }
  .dx-ap .ap-l { padding-top: 8px; font: 700 13px var(--f-body); color: var(--ink); }
  .ap-full { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ap-short { display: inline; }
  .dx-ap textarea { font-size: 16px; line-height: 1.45; padding: 6px 8px; border-color: transparent; background: var(--tint); border-radius: 8px; }
  .dx-ap textarea:focus { background: var(--surface); border-color: var(--ink); outline: none; }
  .dx-general { padding: 8px; }
  .dx-general > .fine { display: none; }
  .dx-group-head { gap: 6px; }

  /* Billing: the same tighter cards. */
  .bill-panel { padding-top: 8px; margin-top: 0; gap: 6px; }
  .bill-panel > .fine { font-size: 12.5px; }
  .bill-item { padding: 8px 46px 8px 10px; gap: 6px; }
  .bill-item > .dx-actions { top: 6px; right: 6px; padding: 0; }
  .bill-mods select { width: 118px; font-size: 16px; }
  .bill-units input { font-size: 16px; width: 52px; }

  /* Bottom bar: one row. Its status opens the review list as a sheet. */
  .action-bar { margin-inline: -20px; flex-wrap: nowrap; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px)); margin-top: 8px; }
  .ab-status { flex: 1 1 auto; display: grid; gap: 0; font-size: 14px; min-width: 0; }
  .ab-status .ab-review { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ab-status .ab-review:not(:disabled)::after { content: " ▴"; font-size: 11px; }
  .ab-status .ab-review[aria-expanded="true"]::after { content: " ▾"; }
  .ab-wide, #hist-ab-next { display: none; }
  #hist-save-state { font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ab-buttons { flex: none; }
  .ab-buttons .btn { flex: none; min-width: 0; padding: 10px 14px; }
  #hist-review:not(.as-sheet) { display: none; }
  #hist-review.as-sheet { position: fixed; left: 8px; right: 8px; bottom: calc(var(--ab-h, 60px) + 8px); z-index: 61; margin: 0; max-height: 60vh; overflow-y: auto; box-shadow: 0 -8px 30px rgba(19, 49, 92, .25); }
  #hist-review.as-sheet .review-close { display: inline; }

  /* While typing, the bars step aside for the keyboard. */
  body.is-typing .action-bar { opacity: 0; transform: translateY(100%); pointer-events: none; }
  body.is-typing .note-jump { opacity: 0; transform: translateY(-100%); pointer-events: none; }
}

/* Template suggestions and learning progress */
.lib-reason { display: block; font-size: 12.5px; color: var(--muted); }
.lib-reason.billed { color: #1D7F4E; font-weight: 600; }
.lib-why { margin: 0; }
.learn-row { display: grid; gap: 2px; }
.learn-row .fine { margin: 0 0 0 26px; }

/* ==== Phones: + / − folding, and editing that's left to a computer ============= */
.sec-fold, .phone-only, .fold-all, .bill-units-ro { display: none; }
div.note-section > .sec-head > .sec-peek, #hist-dx-peek, #hist-bill-peek { display: none; }
@media (max-width: 640px) {
  .sec-fold { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none; padding: 0; cursor: pointer;
    border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 700 17px/1 var(--f-body); }
  .sec-fold:hover { border-color: var(--ink); }
  .fold-all { display: inline-block; }
  .phone-only { display: block; }
  .bill-units-ro { display: inline; font-size: 13px; color: var(--muted); }
  /* A folded section is its heading line and the start of its text. */
  div.note-section.folded > .sec-head > .sec-peek, #hist-dx.folded #hist-dx-peek, #hist-step-bill.folded #hist-bill-peek {
    display: block; flex: 1 1 auto; min-width: 0; font: 400 13px var(--f-body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-transform: none; letter-spacing: 0; }
  div.note-section.folded > :not(.sec-head) { display: none !important; }
  div.note-section.folded .sec-tools { display: none; }
  div.note-section.folded { padding-bottom: 4px; }
  .sec-head h4 { flex: none; }
  #hist-dx .note-out-head { gap: 8px; }
  #hist-dx .note-out-head h4 { flex: none; }
  #hist-dx .note-out-head .sec-fold { margin-left: auto; }
  #hist-dx.folded > :not(.note-out-head) { display: none !important; }
  #hist-step-bill .step-h .sec-fold { margin-left: auto; }
  #hist-step-bill.folded > .bill-panel { display: none; }
  /* The folded letterhead and billing summary use the same + / −. */
  details.note-section > summary::after { content: "+"; display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
    border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: 700 17px/1 var(--f-body); }
  details.note-section[open] > summary::after { content: "−"; }

  /* Left to a computer: regrouping and reordering, re-suggesting, rewriting, and billing edits. */
  #hist-rewrite, .dx-suggest-menu, .dx-handle, .menu-pop [data-dx="group-up"], .menu-pop [data-dx="ungroup"], .menu-pop [data-dx="up"], .menu-pop [data-dx="down"],
  [data-dx-ungroup-all], .bill-add, .bill-item > .dx-actions, .bill-mods select, .mod-chip button, .bill-units, .dx-chip[aria-pressed="false"] { display: none !important; }
  .dx-chip { pointer-events: none; }
  .bill-item { padding-right: 10px; }
  .dx-item { padding-left: 10px; }
}

/* Touch Mode: no specialty name above the page titles (it's set on the Profile page). */
.touch-mode #specialty-eyebrow, .touch-mode #session-specialty, .touch-mode #scribe-specialty, .touch-mode #op-specialty { display: none !important; }
#specialty-panel .specialty-picker { max-width: 520px; }
.rec-recovered { background: #1F4A78; }
.rec-recovered a, .rec-recovered .linklike { color: #FFFFFF; font-weight: 600; margin-left: 8px; }
.dx-panel { grid-template-columns: minmax(0, 1fr); }
.dx-panel > .note-out-head, #hist-step-bill .step-h { min-width: 0; }

/* A group's codes, folded under its name */
.dx-group-toggle { flex-basis: 100%; justify-self: start; text-align: left; font: 600 13px var(--f-body); color: var(--ink); background: var(--tint); border: 1.5px solid transparent; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.dx-group-toggle:hover, .dx-group-toggle[aria-expanded="true"] { border-color: var(--line); }
.dx-group-toggle.has-warn::after { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #E0A100; margin-left: 6px; vertical-align: 1px; }

/* Finding the patient's language from speech */
.detect-lang { display: grid; gap: 8px; justify-items: start; margin: 0 0 18px; padding: 14px 16px; border: 1.5px dashed var(--line); border-radius: 16px; background: var(--surface); }
.detect-btn { display: inline-flex; align-items: center; gap: 10px; }
.detect-btn svg { width: 20px; height: 20px; }
.detect-btn.is-recording { background: #B3261E; border-color: #B3261E; animation: pulse 1.2s ease-in-out infinite; }
.detect-lang .fine { margin: 0; }
.detect-ask { margin: 0; font-size: 15px; color: var(--ink); line-height: 1.6; }
.detect-result { display: grid; gap: 8px; width: 100%; }
.detect-result p { margin: 0; }
.detect-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detect-pick b { font-size: 20px; color: var(--ink); }
.detect-alts { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.touch-mode .detect-btn { min-height: 64px; font-size: 19px; padding: 16px 26px; }

/* The session may be in the wrong language */
.lang-switch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; padding: 10px 14px; border-radius: 12px; background: #FFF4DB; color: #5C3900; font-weight: 600; }
.lang-switch-actions { display: flex; gap: 8px; }

/* Forms of address (Vietnamese) */
.address-table { min-width: 560px; }
.address-table input { width: 100%; min-width: 0; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); color: inherit; }
.address-table input[type="number"] { width: 72px; }
.address-table td { vertical-align: middle; }
.address-hint { font-size: 13px; color: var(--muted); white-space: nowrap; }
.address-hint b { color: var(--ink); font-weight: 600; }
.address-table td:first-child { white-space: nowrap; }

/* Beta mode (test accounts) */
.beta-banner { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: #FFF4D6; color: #6A4300; border: 1px solid #F0D48A; font-size: 14px; line-height: 1.45; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .beta-banner { background: #3A2C10; color: #F1C46B; border-color: #5A4418; } }

/* Admin console (admin.aurikal.ai) */
.admin-body { background: var(--bg, #F4F6FA); min-height: 100vh; }
.admin-top { display: flex; align-items: center; gap: 12px; padding: 14px 20px; background: var(--surface, #fff); border-bottom: 1px solid var(--line); }
.admin-top b { font-family: var(--f-display, inherit); color: var(--ink); }
.admin-who { margin-left: auto; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.admin-main { max-width: 1040px; margin: 0 auto; padding: 20px 16px 48px; display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
.admin-invite { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; }
.admin-link { margin-top: 14px; padding: 12px; border-radius: 10px; background: var(--tint); }
.admin-link p { margin: 0 0 8px; }
.admin-link-row { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-link-row input { flex: 1 1 260px; min-width: 0; font: 13px var(--f-mono, monospace); padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); color: inherit; }
.admin-table { min-width: 720px; }
.admin-actions { white-space: nowrap; text-align: right; }
.admin-actions .btn + .btn { margin-left: 6px; }
.badge.admin-pending, .badge.admin-active { background: var(--good-bg, #E3F4EC); color: var(--good, #1D7F4E); }
.badge.admin-expired, .badge.admin-revoked, .badge.admin-disabled { background: var(--line); color: var(--muted); }
.badge.admin-accepted { background: var(--tint); color: var(--ink); }
.beta-banner { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.beta-banner span { flex: 1 1 260px; min-width: 0; }
.beta-banner.beta-paused { background: var(--tint); color: var(--ink); border-color: var(--line); }
.admin-search { display: grid; grid-template-columns: minmax(0, 1fr) 90px auto; gap: 10px; align-items: end; }
.admin-state input { text-transform: uppercase; }
.admin-results { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.admin-results li, .admin-picked { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); }
.admin-results li small, .admin-picked small, .admin-table small { color: var(--muted); }
.admin-npi { grid-column: 1 / -1; display: grid; gap: 8px; }
.admin-npi[hidden] { display: none; }
.admin-picked { background: var(--tint); }
#org-detail { margin-top: 14px; }
#org-detail h3 { font-size: 16px; margin: 0 0 8px; color: var(--ink); }
@media (max-width: 560px) { .admin-search { grid-template-columns: minmax(0, 1fr) 80px; } .admin-search .btn { grid-column: 1 / -1; } }

/* ---- Enterprise: Organization view, admin console org detail, invoices ---- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ent-pick { max-width: 320px; }
.ent-h3, #org-detail h3 { font-size: 16px; margin: 22px 0 8px; color: var(--ink); }
.ent-row, .admin-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.ent-row .field, .admin-row .field { flex: 1 1 200px; min-width: 0; }
.ent-grid { display: grid; gap: 12px; }
.ent-wide { grid-column: 1 / -1; }
.ent-depts { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.ent-depts li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface, #fff); }
.ent-depts li input { flex: 1 1 200px; min-width: 0; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: inherit; }
.ent-depts li small { color: var(--muted); }
#ent-members select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); color: inherit; max-width: 220px; }
.invoice { margin-top: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface, #fff); }
.invoice:empty { display: none; }
.inv-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.inv-head small { color: var(--muted); }
.inv-to { text-align: right; }
.inv-status { margin: 12px 0; font-size: 14px; }
.inv-draft { color: var(--muted); }
.inv-table { width: 100%; }
.inv-table .inv-group th { text-align: left; padding-top: 14px; color: var(--ink); }
.inv-table .inv-sub td { font-weight: 600; border-top: 1px solid var(--line); }
.inv-table tfoot th { font-size: 16px; border-top: 2px solid var(--ink); }
@media (max-width: 560px) { .inv-to { text-align: left; } }
@media print {
  body.printing-invoice * { visibility: hidden; }
  body.printing-invoice .inv-printing, body.printing-invoice .inv-printing * { visibility: visible; }
  body.printing-invoice .inv-printing { position: absolute; left: 0; top: 0; width: 100%; border: 0; }
}
/* BAA page: sending the agreement to the signer */
.baa-who { border: 0; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.baa-who[hidden] { display: none; }
.baa-requests { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--tint); }
.baa-requests h2 { font-size: 16px; margin: 0 0 8px; }
.baa-requests ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.baa-requests li { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.baa-requests small { color: var(--muted); }
.nav-short { display: none; }
@media (max-width: 560px) { .nav-long { display: none; } .nav-short { display: inline; } }
.view-head > * { min-width: 0; }
.provider-lang { min-width: 0; max-width: 100%; }
.provider-lang select { min-width: 0; max-width: 100%; flex: 1 1 auto; }
.lang-tools { margin-bottom: 10px; }
.lang-tools .fine { margin: 0 0 8px; }
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 13px; }
.switch input { width: 18px; height: 18px; accent-color: var(--accent, #1E6E8C); }
/* Languages with weaker models or not benchmarked yet */
.lang-quality { justify-self: start; font: 600 11px var(--f-body); border-radius: 999px; padding: 2px 8px; margin-top: 2px; }
.lang-quality-limited { background: #FFF1D6; color: #7A4B00; }
.lang-quality-untested { background: var(--tint, #EEF2F7); color: var(--muted); }
.lang-notice { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.45; }
.lang-notice-limited { background: #FFF1D6; color: #5C3800; border: 1px solid #F0D49A; }
.lang-notice-untested { background: var(--tint, #EEF2F7); color: var(--ink, #13315C); border: 1px solid var(--line, #DCE2EC); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .lang-quality-limited, :root:not([data-theme="light"]) .lang-notice-limited { background: #3A2C10; color: #F1C46B; border-color: #5a4518; } }
:root[data-theme="dark"] .lang-quality-limited, :root[data-theme="dark"] .lang-notice-limited { background: #3A2C10; color: #F1C46B; border-color: #5a4518; }
.admin-wide { grid-column: 1 / -1; }
/* Sign-up: first, middle and last name and title */
.name-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.name-grid .name-hint { grid-column: 1 / -1; }
.name-grid label small, .field label small { font-weight: 400; color: var(--muted); }
@media (max-width: 420px) { .name-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- Interpretation / Scribe switch (languages page, session, Scribe) -------------------- */
:root {
  --ms-int: #13315C; --ms-int-text: #FFFFFF; --ms-scribe: #0F6E63; --ms-scribe-text: #FFFFFF;
}
/* Dark mode: light highlights with dark text, so the selected side stands out from the page */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --ms-int: #A9C4F0; --ms-int-text: #0B1B33; --ms-scribe: #7FD1BF; --ms-scribe-text: #062520; }
}
:root[data-theme="dark"] { --ms-int: #A9C4F0; --ms-int-text: #0B1B33; --ms-scribe: #7FD1BF; --ms-scribe-text: #062520; }
.mode-bar { display: flex; justify-content: center; margin-bottom: 18px; }
.mode-switch {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(460px, 100%);
  padding: 5px; border: 1px solid var(--line); border-radius: 999px; background: var(--tint); cursor: pointer; font: inherit;
}
.mode-switch:focus-visible { outline: 3px solid color-mix(in srgb, var(--rose) 45%, transparent); outline-offset: 3px; }
.ms-thumb {
  position: absolute; top: 5px; bottom: 5px; left: 5px; width: calc(50% - 5px); border-radius: 999px;
  background: var(--ms-int); box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .22s ease, background .22s ease;
}
.mode-switch[aria-checked="true"] .ms-thumb { transform: translateX(100%); background: var(--ms-scribe); }
.ms-opt {
  position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-width: 0;
  padding: 10px 10px; font: 600 16px var(--f-body); color: var(--muted); transition: color .2s ease; white-space: nowrap; overflow: hidden;
}
.ms-opt svg { width: 20px; height: 20px; flex: none; }
.mode-switch[aria-checked="false"] .ms-int { color: var(--ms-int-text); }
.mode-switch[aria-checked="true"] .ms-scribe { color: var(--ms-scribe-text); }
@media (prefers-reduced-motion: reduce) { .ms-thumb { transition: none; } }
.touch-mode .mode-switch { width: min(640px, 100%); }
.touch-mode .ms-opt { padding: 16px 10px; font-size: clamp(17px, 4.6vw, 22px); gap: 10px; }
.touch-mode .ms-opt svg { width: 26px; height: 26px; }
/* Narrow phones: the words alone, so "Interpretation" fits inside its half */
@media (max-width: 430px) {
  .ms-opt svg { display: none; }
  .ms-opt { font-size: 15px; padding: 10px 6px; }
  .touch-mode .ms-opt { font-size: 18px; padding: 14px 6px; }
}

/* Scribe mode on the languages page: start without choosing, or pick the patient's language */
body:not([data-mode="scribe"]) .scribe-mode-only { display: none !important; }
/* Scribe home: no language choice (Scribe finds the languages spoken). */
body[data-mode="scribe"] #view-languages .interp-only { display: none !important; }
button.scribe-auto { width: 100%; border: 0; text-align: left; cursor: pointer; font: inherit; margin-bottom: 18px; }
body[data-mode="scribe"] #detect-panel { display: none; }
.scribe-auto {
  display: flex; align-items: center; gap: 16px; padding: 18px 20px; margin-bottom: 18px; border-radius: 18px;
  background: #0F6E63; color: #FFFFFF; text-decoration: none;
}
.scribe-auto svg { width: 34px; height: 34px; flex: none; }
.scribe-auto > span { display: grid; gap: 4px; }
.scribe-auto b { font-size: 20px; }
.scribe-auto span span { font-size: 15px; opacity: .92; }
.touch-mode .scribe-auto { padding: 24px 28px; }
.touch-mode .scribe-auto b { font-size: 26px; }

/* The patient's language on the Scribe page */
.scribe-lang {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
}
.scribe-lang.is-auto { background: #EAF6F3; border-color: #9FD3C7; }
.scribe-lang-flag img { display: block; width: 36px; height: 27px; border-radius: 4px; }
.scribe-lang-text { display: grid; gap: 2px; flex: 1 1 220px; min-width: 0; }
.scribe-lang-text b { color: var(--ink); font-size: 16px; }
.scribe-lang-text span { color: var(--muted); font-size: 14px; }
.touch-mode .no-touch { display: none !important; }

/* ---- Interpreter session: Pause and Stop ----------------------------------------- */
.session-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.session-actions .btn svg { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.session-pause {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; margin-bottom: 14px; border-radius: 14px; background: var(--blush); color: var(--text);
}
.session-pause[hidden] { display: none; }
.session-pause p { margin: 0; }
.talk-row.is-paused .talk { opacity: .45; }
.touch-mode .session-actions .btn { min-height: 52px; padding: 12px 20px; font-size: 17px; }
.touch-mode .session-pause { padding: 20px 24px; font-size: 18px; }
.touch-mode .session-pause .btn { min-height: 56px; padding: 14px 28px; font-size: 18px; }

/* ---- Schedule (appointments from athenaOne) ------------------------------------- */
.sched-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sched-bar input[type="date"] { min-height: 40px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.sched-next svg { transform: scaleX(-1); }
.sched-spacer { flex: 1; }
.sched-import { display: grid; gap: 12px; }
.sched-import h2 { font-size: 18px; color: var(--ink); }
.ath-file input { display: none; }
.ath-step, .ath-preview { display: grid; gap: 10px; justify-items: start; }
.ath-map select { min-width: 200px; }
.sched-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sched-list .empty { padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); }
.sched-day { font: 600 13px var(--f-body); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; padding: 4px 2px; }
.sched-row {
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.sched-row.is-started { border-color: #9FD3C7; background: #F3FAF8; }
.sched-time { font: 600 15px var(--f-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.sched-main { display: grid; gap: 3px; min-width: 0; }
.sched-main b { color: var(--ink); font-size: 16px; }
.sched-who { color: var(--muted); font-size: 14px; }
.sched-meta { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.sched-meta .badge { padding: 2px 8px; font-size: 11px; }
.sched-lang { display: inline-flex; align-items: center; gap: 6px; }
.sched-lang img { border-radius: 3px; }
.sched-lang.is-off { opacity: .7; }
.sched-started { color: #0F6E63; font-weight: 600; }
.sched-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 560px) {
  .sched-row { grid-template-columns: 64px minmax(0, 1fr); }
  .sched-actions { grid-column: 1 / -1; justify-content: stretch; }
  .sched-actions .btn { flex: 1; }
}
.scribe-patient { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--blush); color: var(--ink); font-weight: 600; }
.scribe-patient[hidden] { display: none; }

/* ---- Admin console: one organization's own page ---------------------------------- */
body:not(.org-page) .org-page-only { display: none !important; }
.org-page .org-list-only, .org-page main > section:not(:first-child) { display: none !important; }
.org-page #org-detail-h { display: none; }
.admin-back { display: inline-block; margin-bottom: 4px; color: var(--muted); text-decoration: none; font-size: 14px; }
.admin-back:hover { color: var(--ink); }

/* Scribe's "choose the patient" screen on touch screens: the day's patients first */
.sched-pick { display: grid; gap: 10px; margin-bottom: 18px; }
.sched-pick[hidden] { display: none; }
.sched-pick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.sched-pick-head h2 { font-size: 22px; color: var(--ink); }
.sched-pick-nav { display: flex; gap: 6px; align-items: center; }
.sched-pick-note { margin: 0; color: #0F6E63; font-weight: 600; }
.sched-pick .sched-row { cursor: default; }

.sched-pick-done { margin-top: 6px; }
.sched-pick-done summary { cursor: pointer; font-weight: 600; color: var(--muted); padding: 8px 2px; display: flex; align-items: center; gap: 8px; }
.sched-pick-done[open] summary { margin-bottom: 6px; }
.sched-row.is-signed { opacity: .75; }
.touch-mode .sched-pick-head h2 { font-size: 28px; }
.touch-mode .sched-pick .sched-row { padding: 12px 16px; border-width: 2px; border-radius: 16px; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 4px 14px; }
.touch-mode .sched-pick .sched-time { font-size: 17px; }
.touch-mode .sched-pick .sched-main b { font-size: 19px; }
.touch-mode .sched-pick .sched-meta { font-size: 14px; }
.touch-mode .sched-pick .sched-actions .btn { min-height: 46px; padding: 10px 18px; font-size: 16px; }
.touch-mode .sched-pick .sched-list { gap: 8px; }
@media (max-width: 560px) {
  .touch-mode .sched-pick .sched-row { grid-template-columns: 76px minmax(0, 1fr); }
}

/* Tinted cards that read in light and dark mode (instead of fixed light backgrounds) */
.sched-row.is-started { background: color-mix(in srgb, #0F6E63 12%, var(--surface)); border-color: color-mix(in srgb, #0F6E63 45%, var(--line)); }
.scribe-lang.is-auto { background: color-mix(in srgb, #0F6E63 12%, var(--surface)); border-color: color-mix(in srgb, #0F6E63 40%, var(--line)); }
.sched-started, .sched-pick-note { color: var(--ms-scribe); }
.sched-time { white-space: nowrap; }
@media (max-width: 560px) {
  .touch-mode .sched-pick .sched-row { grid-template-columns: 76px minmax(0, 1fr); }
  .touch-mode .sched-pick .sched-time { font-size: 15px; }
}

/* Dictated plans: a microphone on each problem's plan, and "Dictate plans" for all of them */
.dx-ap { position: relative; }
.dx-ap .ap-row:nth-of-type(2) textarea { padding-right: 44px; }
.dx-mic { position: absolute; right: 4px; bottom: 4px; width: 34px; height: 34px; }
.dx-mic svg { width: 17px; height: 17px; }
.dx-mic.is-recording, .dx-mic-all.is-recording { background: #E05A47; border-color: #E05A47; color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.dx-dictate-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 4px 0 8px; }
.dx-dictate-row[hidden] { display: none; }
.dx-mic-all svg { width: 15px; height: 15px; margin-right: 6px; vertical-align: -2px; }

/* Copy note: basic text or rich formatting */
.menu-pop.menu-up { top: auto; bottom: calc(100% + 6px); }
.copy-menu .menu-pop { min-width: 260px; }
.copy-menu .menu-pop > button { display: grid; gap: 2px; }
.copy-menu .menu-pop > button b { font-size: 14px; color: var(--ink); }
.copy-menu .menu-pop > button small { font-size: 12px; color: var(--muted); }
.copy-menu > summary { padding: 10px 18px; font-size: 15px; }
.ab-copy > summary { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.ab-copy > summary::after { color: inherit; }
.ab-copy[hidden] { display: none; }

/* Touch Mode while recording: one full screen, nothing to scroll */
html.rec-locked, html.rec-locked body { overflow: hidden; overscroll-behavior: none; touch-action: none; height: 100%; }
.rec-focus {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
  background: var(--bg, #F3F5F9); color: var(--text); touch-action: none; overscroll-behavior: contain;
}
.rec-focus[hidden] { display: none; }
.rec-focus-inner { display: grid; justify-items: center; gap: 14px; width: min(560px, 100%); text-align: center; }
.rec-focus-patient { margin: 0; font: 600 clamp(18px, 4.6vw, 24px) var(--f-body); color: var(--ink); }
.rec-focus-dot { width: 22px; height: 22px; border-radius: 50%; background: #E05A47; box-shadow: 0 0 0 0 rgba(224, 90, 71, .5); animation: rec-pulse 1.6s ease-out infinite; }
@keyframes rec-pulse { 0% { box-shadow: 0 0 0 0 rgba(224, 90, 71, .55); } 100% { box-shadow: 0 0 0 26px rgba(224, 90, 71, 0); } }
@media (prefers-reduced-motion: reduce) { .rec-focus-dot { animation: none; } }
.rec-focus-time { margin: 0; font: 600 clamp(56px, 18vw, 104px)/1 var(--f-mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.rec-focus-state { margin: 0; font: 600 18px var(--f-body); color: #E05A47; text-transform: uppercase; letter-spacing: .08em; }
.rec-focus-status { margin: 0; min-height: 1.4em; font-size: 15px; color: var(--muted); }
.rec-focus-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; margin-top: 12px; }
.rec-focus-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 140px;
  border-radius: 24px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: 700 22px var(--f-body); cursor: pointer;
  touch-action: manipulation;
}
.rec-focus-btn svg { width: 34px; height: 34px; }
.rec-focus-btn:active:not(:disabled) { transform: scale(.98); }
.rec-focus-btn:disabled { opacity: .6; }
.rec-focus-done { background: var(--ms-scribe); border-color: var(--ms-scribe); color: var(--ms-scribe-text); }
.rec-focus-hint { margin: 4px 0 0; font-size: 14px; color: var(--muted); max-width: 46ch; }
@media (max-height: 560px) { .rec-focus-btn { min-height: 96px; } .rec-focus-time { font-size: 56px; } }
.scribe-lang-pick select { min-height: 40px; max-width: 100%; padding: 8px 36px 8px 12px; border-radius: 10px; font: 15px var(--f-body); }
.scribe-lang-pick[hidden] { display: none; }
.touch-mode .scribe-lang-pick select { min-height: 52px; font-size: 18px; }

/* Note writing preferences (Profile) and the normal-exam menu */
.style-choice { border: 0; padding: 0; margin: 0 0 4px; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.style-choice legend { font: 600 14px var(--f-body); color: var(--ink); margin-bottom: 6px; }
.style-choice label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: var(--surface); }
.style-choice label:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.style-choice span { display: grid; gap: 2px; }
.style-choice small { color: var(--muted); font-size: 13px; }
.ne-list { display: grid; gap: 12px; margin: 8px 0; }
.ne-item { display: grid; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.ne-name { font: 600 15px var(--f-body); padding: 8px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); }
.ne-text { font-size: 14px; }
.ne-actions { display: flex; gap: 8px; }
.sec-tools { position: relative; }
.ne-pop { min-width: 220px; }
.ne-pop .ne-edit { display: block; padding: 8px 10px; font-size: 13px; color: var(--muted); }

/* Interpreter voices */
.voice-open svg { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; }
.session-head .voice-open { margin-left: auto; }
.voice-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.voice-tabs [role="tab"] { border: 1.5px solid var(--line); background: var(--surface); color: var(--text); border-radius: 999px; padding: 6px 14px; font: 600 14px var(--f-body); cursor: pointer; }
.voice-tabs [role="tab"][aria-selected="true"] { border-color: var(--ink); color: var(--ink); box-shadow: 0 0 0 1px var(--ink) inset; }
.voice-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: min(60vh, 520px); overflow-y: auto; }
.voice-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.voice-row.is-selected { border-color: var(--ink); }
.voice-text { display: grid; gap: 2px; min-width: 0; }
.voice-text .fine { overflow-wrap: anywhere; }
.voice-play.is-loading { opacity: .5; }

.ne-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.sig-section .sec-head { display: flex; align-items: center; gap: 12px; }
.sig-include { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; margin-left: auto; }
.sig-include input { width: 18px; height: 18px; accent-color: var(--ink); }
.sig-section .sig-locked { background: var(--tint, #F3F5F9); color: var(--muted); cursor: default; }
.sig-section.is-off { border-left-style: dashed; }
.sig-section.is-off h4, .sig-section.is-off .sig-locked { opacity: .55; text-decoration: line-through; text-decoration-thickness: 1px; }
.sig-section .sig-note { margin: 0; }
.tpl-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.tpl-bar-label { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tpl-bar b { color: var(--ink); min-width: 0; overflow-wrap: anywhere; flex: 1 1 160px; }
/* ---- Interpreter: always listening ------------------------------------------------ */
.interp-controls { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.seg { display: inline-flex; background: var(--tint, #F3F5F9); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 4px; max-width: 100%; }
.seg button { font: 600 14px var(--f-body); color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 9px 16px; cursor: pointer; display: inline-flex; align-items: baseline; gap: 6px; min-height: 40px; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--on-ink, #fff); box-shadow: 0 2px 8px -4px rgba(19, 49, 92, .5); }
.seg-speaker button[data-speaker="patient"][aria-checked="true"] { background: var(--rose, #EF6F6C); }
.seg-speaker button span { font-weight: 500; font-size: 13px; opacity: .85; }
.seg-speaker button.is-auto { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.seg-speaker button[data-speaker="patient"].is-auto { background: transparent; color: var(--rose-strong, #D9534F); box-shadow: inset 0 0 0 1.5px var(--rose, #EF6F6C); }
.talk.talk-live { cursor: default; background: var(--surface); color: var(--text); border: 1.5px solid var(--line); min-height: 0; padding: 22px 18px; }
.talk.talk-live:hover { transform: none; }
.talk-live .talk-lang { color: var(--ink); font-size: 22px; }
.talk-live .talk-hint { font-size: 17px; font-weight: 600; color: var(--ink); opacity: 1; }
.talk-live .talk-who { text-transform: none; letter-spacing: 0; font: 400 14px/1.45 var(--f-body); color: var(--muted); opacity: 1; max-width: 46ch; }
.live-ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--tint, #F3F5F9); color: var(--muted); margin-bottom: 6px; }
.live-ring svg { width: 30px; height: 30px; margin: 0; }
.talk-live.is-recording { box-shadow: none; animation: none; border-color: var(--mint, #1FA897); }
.talk-live.is-recording .live-ring { background: var(--mint, #1FA897); color: #fff; animation: live-pulse 1.6s ease-out infinite; }
.talk-live.is-busy .live-ring { background: var(--ink); color: #fff; }
.talk-live.is-off { cursor: pointer; }
.talk-live.is-off .live-ring { background: var(--line); }
@keyframes live-pulse { 0% { box-shadow: 0 0 0 0 rgba(31, 168, 151, .45); } 100% { box-shadow: 0 0 0 18px rgba(31, 168, 151, 0); } }
@media (prefers-reduced-motion: reduce) { .talk-live.is-recording .live-ring { animation: none; } }
.session-more { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; background: var(--surface); }
.session-more summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.session-more[open] summary { margin-bottom: 10px; }
.session-more .type-row { margin-top: 10px; }
.touch-mode .talk.talk-live { min-height: min(34vh, 320px); }
@media (max-width: 560px) {
  .interp-controls { flex-direction: column; align-items: stretch; }
  .seg { display: grid; grid-template-columns: 1fr 1fr; }
  .seg button { justify-content: center; padding: 9px 8px; }
}
/* Op report: "Not dictated" placeholders highlighted behind the text box */
.hl-wrap { position: relative; }
.hl-wrap .hl-back { position: absolute; inset: 0 auto auto 0; width: 100%; overflow: hidden; white-space: pre-wrap; overflow-wrap: break-word; color: transparent; pointer-events: none; margin: 0; scrollbar-gutter: stable; }
.hl-wrap .hl-front { position: relative; background: transparent; scrollbar-gutter: stable; }
.hl-back mark, #op-placeholder-note mark { background: #FFE6A6; color: transparent; border-radius: 4px; box-shadow: 0 0 0 2px #FFE6A6; }
#op-placeholder-note mark { color: #6B4A00; font-weight: 600; padding: 0 2px; }
#op-report[readonly] { background: var(--tint, #F3F5F9); }
:root[data-theme="dark"] .hl-back mark { background: #5C4710; box-shadow: 0 0 0 2px #5C4710; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .hl-back mark { background: #5C4710; box-shadow: 0 0 0 2px #5C4710; } }

/* Scribe's patient picker: compact tiles (name and age on one line, the details on the next) */
.sched-pick .sched-main { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; row-gap: 2px; }
.sched-pick .sched-name { flex-basis: 100%; }
.sched-pick .sched-row { padding-top: 10px; padding-bottom: 10px; }

/* Schedule tiles: the language chip (tap to change), and the "Signed" divider in Touch Mode's list */
.sched-lang-btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; color: inherit; background: var(--tint, #F3F5F9); border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px 1px 6px; cursor: pointer; min-height: 30px; }
.sched-lang-btn:hover { border-color: var(--ink); }
.sched-lang-btn img { border-radius: 3px; }
.sched-lang-edit { font-size: 11px; color: var(--muted); }
.sched-lang-pick { font: inherit; min-height: 36px; border-radius: 10px; border: 1.5px solid var(--ink); padding: 4px 8px; max-width: 100%; }
.touch-mode .sched-lang-btn { min-height: 36px; padding: 2px 12px 2px 8px; }
.sched-divider { list-style: none; font: 600 13px var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 14px 4px 2px; border-top: 1px dashed var(--line); margin-top: 6px; }
#session-appt { margin: 0 0 10px; }

/* A paused visit on the schedule: first in Touch Mode's list, with Resume recording */
.sched-row.is-paused { border-color: color-mix(in srgb, #B26B00 55%, var(--line)); background: color-mix(in srgb, #B26B00 8%, var(--surface)); }
.sched-paused { color: #8A5300; font-weight: 600; }
.sched-actions .btn svg { width: 18px; height: 18px; margin-right: 6px; vertical-align: -3px; }
:root[data-theme="dark"] .sched-paused { color: #E8B25C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sched-paused { color: #E8B25C; } }

/* Phones: the section tabs as a grid (3 across), so every label fits without running together. */
@media (max-width: 640px) {
  .mode-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 4px; overflow: visible; }
  .mode-nav a { display: flex; align-items: center; justify-content: center; min-width: 0; padding: 9px 4px; font-size: 14px; white-space: nowrap; }
  .mode-nav a[hidden] { display: none; }
}

/* Phones: the header (with the section tabs) scrolls away with the page instead of covering a
   fifth of the screen; scroll up to reach it. Pages with their own bar (an open visit) keep it. */
@media (max-width: 640px) {
  body:not(.touch-mode) .app-header { position: static; }
}

/* Visits list: the summary always takes two lines ("Summary coming…" included), so rows don't
   grow when summaries arrive and the list doesn't move under the reader. */
.hist-text-col > b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; min-height: calc(2 * 1.35em); }

/* In the app the page never glides by itself: changing pages, keeping the reader's place and
   sizing note boxes all happen at once (the marketing site's smooth scrolling made each of those
   an animation, and on a phone that reads as the page jumping around). The "jump to" buttons
   still glide; they ask for it themselves. */
html { scroll-behavior: auto; }

/* Notes being written / ready to review (top of Scribe and of the day's patients) */
.note-jobs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.note-jobs[hidden] { display: none; }
.note-job { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); }
.note-job.is-writing { border-color: color-mix(in srgb, var(--ink) 35%, var(--line)); }
.note-job.is-ready { border-color: color-mix(in srgb, #0F6E63 55%, var(--line)); background: color-mix(in srgb, #0F6E63 8%, var(--surface)); }
.note-job.is-failed { border-color: color-mix(in srgb, #B3261E 50%, var(--line)); }
.nj-icon { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--ink); }
.note-job.is-ready .nj-icon { background: #0F6E63; }
.note-job.is-failed .nj-icon { background: #B3261E; }
.note-job.is-writing .nj-icon { background: transparent; }
.nj-spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid color-mix(in srgb, var(--ink) 20%, transparent); border-top-color: var(--ink); animation: nj-spin 0.9s linear infinite; }
@keyframes nj-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .nj-spin { animation-duration: 3s; } }
.nj-text { flex: 1; min-width: 0; display: grid; gap: 1px; }
.nj-text b { color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nj-text small { color: var(--muted); font-size: 13px; }
.note-job.is-ready .nj-text small { color: #0F6E63; font-weight: 600; }
.nj-close { flex: none; width: 32px; height: 32px; font-size: 20px; color: var(--muted); }
.touch-mode .note-job { padding: 12px 16px; }
.touch-mode .nj-text b { font-size: 18px; }

.elsewhere-banner { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, #0F6E63 10%, var(--surface)); border: 1px solid color-mix(in srgb, #0F6E63 40%, var(--line)); color: var(--ink); font-weight: 600; }
.elsewhere-banner[hidden] { display: none; }

/* Procedure sections: the template's wording with drop-downs in place */
.proc-section .pf-body { font: 15px/2.1 var(--f-body); color: var(--text); background: var(--surface); border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 16px; overflow-wrap: anywhere; }
.pf-body select, .pf-body .pf-text { font: inherit; line-height: 1.3; color: var(--ink); background: var(--tint, #F3F5F9); border: 1.5px solid var(--line); border-radius: 8px; padding: 2px 6px; margin: 0 2px; max-width: 100%; }
.pf-body select.is-blank { border-color: #B26B00; background: color-mix(in srgb, #B26B00 10%, var(--surface)); }
.pf-many { display: inline-block; position: relative; vertical-align: baseline; }
.pf-many > summary { display: inline-block; cursor: pointer; list-style: none; color: var(--ink); background: var(--tint, #F3F5F9); border: 1.5px solid var(--line); border-radius: 8px; padding: 0 22px 0 6px; line-height: 1.6; position: relative; }
.pf-many > summary::after { content: "▾"; position: absolute; right: 6px; font-size: 11px; color: var(--muted); }
.pf-many > summary::-webkit-details-marker { display: none; }
.pf-many-pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; }
.pf-many-pop label { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 8px; line-height: 1.3; cursor: pointer; }
.pf-many-pop label:hover { background: var(--tint, #F3F5F9); }
.pt-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px; gap: 10px; }
.pt-field { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.pt-field input { font: inherit; font-size: 15px; color: var(--text); }
#hist-proc-pop button small { color: var(--muted); margin-left: 6px; }

.readonly-note { margin: 4px 0 0; font-size: 13px; color: var(--muted); background: var(--tint, #F3F5F9); border-radius: 8px; padding: 6px 10px; }
.readonly-note[hidden] { display: none; }

/* Delete recording: quieter than Pause and Complete, so it isn't tapped by mistake */
.rec-focus-discard { grid-column: 1 / -1; justify-self: center; margin-top: 6px; background: none; border: 0; color: #B3261E; font: 600 16px var(--f-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 10px 16px; }
.finish-choice.finish-discard b { color: #B3261E; }
.danger-text { color: #B3261E; }
.resume-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Visits list: Delete beside a recording that hasn't become a note */
.hist-item.has-del { display: flex; align-items: stretch; gap: 6px; }
.hist-item.has-del > .hist-row { flex: 1; min-width: 0; }
.hist-row-del { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; width: 64px; border: 1.5px solid var(--line); border-radius: 16px; background: var(--surface); color: #B3261E; font: 600 12px var(--f-body); cursor: pointer; }
.hist-row-del svg { width: 20px; height: 20px; }
.hist-row-del:hover { border-color: #B3261E; background: color-mix(in srgb, #B3261E 6%, var(--surface)); }
@media (max-width: 640px) { .hist-row-del { width: 52px; } }

/* Call + Scribe: the call bar on the Scribe page */
.scribe-call { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 0 0 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); }
.scribe-call[hidden] { display: none; }
.scribe-call-icon { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft, rgba(0,0,0,.06)); color: var(--ink); }
.scribe-call-icon svg { width: 18px; height: 18px; }
.scribe-call-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.scribe-call-text b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scribe-call-text .session-status { margin: 0; }
.sched-actions [data-callscribe] svg, .sched-actions [data-call] svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
/* Profile: Languages I speak */
.spoken-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.spoken-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px; background: var(--surface); }
.spoken-chip.is-on { border-color: var(--ink); font-weight: 600; }
.spoken-chip input { margin: 0; }
.spoken-chip small { color: var(--muted, inherit); font-weight: 400; }

/* Visits: Select several recordings to delete */
.hist-filters .hist-select-btn { margin-left: auto; }
.hist-select-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 12px; border: 1.5px solid var(--ink); border-radius: 14px; background: var(--surface); position: sticky; top: 8px; z-index: 5; }
.hist-select-bar[hidden] { display: none; }
.hist-select-bar .check-inline { font-weight: 600; }
.hist-select-actions { display: flex; gap: 8px; }
.hist-item.is-pick { display: flex; align-items: stretch; gap: 8px; }
.hist-item.is-pick > .hist-row { flex: 1; min-width: 0; }
.hist-item.is-dim > .hist-row { opacity: .45; cursor: default; }
.hist-item.is-dim { padding-left: 44px; }
.hist-check { flex: none; width: 36px; display: grid; place-items: center; cursor: pointer; }
.hist-check input { width: 20px; height: 20px; margin: 0; accent-color: #B3261E; }
.hist-item.is-on > .hist-row { border-color: #B3261E; }
.tpl-match { margin: 6px 0 0; }

/* Touch Mode interpreting: one full screen, nothing to scroll (like Scribe's recording screen).
   The listening panel and the latest turns fill it; Pause and Stop sit at the bottom. */
html.interp-locked, html.interp-locked body { overflow: hidden; overscroll-behavior: none; height: 100%; }
html.interp-locked #view-session {
  position: fixed; inset: 0; z-index: 900; margin: 0; max-width: none;
  display: flex; flex-direction: column; gap: 12px; overflow: hidden; overscroll-behavior: none;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px calc(14px + env(safe-area-inset-bottom, 0px));
  background: var(--bg, #F3F5F9);
}
html.interp-locked #view-session[hidden] { display: none; }
html.interp-locked #view-session > .mode-bar,
html.interp-locked #voice-open,
html.interp-locked #call-unavailable,
html.interp-locked #session-quality,
html.interp-locked #session-more,
html.interp-locked #view-session > p.fine,
html.interp-locked .feed-head h2 { display: none !important; }
html.interp-locked #view-session > * { flex: none; margin: 0; }
html.interp-locked .session-head { gap: 12px; }
html.interp-locked .session-head h1 { font-size: clamp(24px, 3.4vw, 34px); }
html.interp-locked .talk-row { flex: 0 1 auto; min-height: 0; }
html.interp-locked .talk.talk-live { min-height: min(30vh, 300px); }
html.interp-locked #session-status:empty { display: none; }
/* The conversation: newest first, only what fits (no scrolling). */
html.interp-locked #feed { order: 1; flex: 1 1 0; min-height: 0; overflow: hidden; align-content: start; touch-action: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 48px), transparent); }
html.interp-locked .turn { font-size: 17px; }
html.interp-locked .feed-head { order: 2; margin: 0; justify-content: stretch; }
html.interp-locked .feed-head .session-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; width: 100%; }
html.interp-locked .feed-head .session-actions .btn { min-height: 76px; border-radius: 22px; font-size: 22px; font-weight: 700; justify-content: center; gap: 10px; }
html.interp-locked .feed-head .session-actions .btn svg { width: 26px; height: 26px; }
html.interp-locked #session-stop { background: #B3261E; border-color: #B3261E; color: #fff; }
html.interp-locked #session-pause-btn { background: var(--surface); border: 2px solid var(--ink); color: var(--ink); }
html.interp-locked #session-note-open { display: none !important; }
@media (max-height: 760px) { html.interp-locked .talk.talk-live { min-height: 22vh; } html.interp-locked .interp-controls { gap: 8px; } }
/* Paused: the banner (with Resume) takes the listening panel's place, so Stop stays on screen. */
html.interp-locked #view-session:has(#session-pause:not([hidden])) .talk-row { display: none; }
html.interp-locked .session-pause { padding: 16px 20px; }
/* Phones: the language pair once (in the listening panel), a smaller panel, more room for the latest turn. */
@media (max-width: 640px) {
  html.interp-locked .session-title { display: none; }
  html.interp-locked .session-head { justify-content: flex-start; }
  html.interp-locked .interp-controls { gap: 8px; }
  html.interp-locked .talk.talk-live { min-height: 0; padding: 14px 16px; gap: 4px; }
  html.interp-locked .talk.talk-live .live-ring { width: 52px; height: 52px; }
  html.interp-locked .talk.talk-live .live-ring svg { width: 28px; height: 28px; }
  html.interp-locked .talk.talk-live .talk-lang { font-size: 22px; }
  html.interp-locked .talk.talk-live .talk-hint { font-size: 16px; }
  html.interp-locked #talk-mode-help { display: none; }
  html.interp-locked .feed-head .session-actions .btn { min-height: 64px; font-size: 20px; }
  html.interp-locked .turn { font-size: 16px; padding: 12px 14px; }
}

/* ---- Layouts (html[data-layout]: mobile, tablet, desktop; see app.js applyLayout) -------------
   Desktop: the sections in the header, as before (no icons). Mobile and tablet: the sections in a
   bar at the bottom, icon over label. Mobile shows Scribe · Interpret · Notes · Settings; tablet
   every section. Inside a note, interpreting or recording (full-screen views) the bar steps aside. */
.nav-ico { display: none; }
.mode-nav a.is-disabled { opacity: .45; }
html[data-layout="desktop"] .mode-nav a.is-disabled { cursor: not-allowed; }
html[data-layout="mobile"] .user-menu, html[data-layout="tablet"] .user-menu { display: none !important; }
html[data-layout="mobile"] .mode-nav, html[data-layout="tablet"] .mode-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; order: 0; margin: 0;
  display: flex !important; justify-content: space-around; align-items: stretch; gap: 0; overflow: visible;
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); border-radius: 0;
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(19, 49, 92, .08);
}
html[data-layout="mobile"] .mode-nav a, html[data-layout="tablet"] .mode-nav a {
  position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 7px 2px 6px; border-radius: 12px; background: none; box-shadow: none; color: var(--muted);
  font: 600 12px/1.1 var(--f-body); white-space: nowrap; text-align: center; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
html[data-layout="mobile"] .mode-nav a[hidden], html[data-layout="tablet"] .mode-nav a[hidden] { display: none; }
html[data-layout="mobile"] .mode-nav .nav-ico, html[data-layout="tablet"] .mode-nav .nav-ico { display: block; width: 26px; height: 26px; }
html[data-layout="mobile"] .mode-nav a[aria-current="page"], html[data-layout="tablet"] .mode-nav a[aria-current="page"] { color: var(--ink); background: var(--tint); box-shadow: none; }
html[data-layout="mobile"] .mode-nav .nav-badge, html[data-layout="tablet"] .mode-nav .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); margin: 0; }
html[data-layout="mobile"] .mode-nav .nav-full { display: none !important; }
html[data-layout="mobile"] .mode-nav a { font-size: 13px; padding-block: 8px 7px; }
html[data-layout="mobile"] .mode-nav .nav-ico { width: 28px; height: 28px; }
html[data-layout="tablet"] .mode-nav { padding-inline: max(4px, calc((100% - 900px) / 2)); }
html[data-layout="mobile"] body, html[data-layout="tablet"] body { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
html[data-layout="mobile"] body.in-visit .mode-nav, html[data-layout="tablet"] body.in-visit .mode-nav,
html.interp-locked .mode-nav, html.rec-locked .mode-nav { display: none !important; }
html[data-layout="mobile"] body.in-visit, html[data-layout="tablet"] body.in-visit { padding-bottom: 0; }
/* Mobile and tablet: the header is just the logo. */
html[data-layout="mobile"] .app-header-inner, html[data-layout="tablet"] .app-header-inner { justify-content: center; }

/* Settings (top of Profile) */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.settings-row:first-of-type { border-top: 0; }
.settings-row .fine { margin: 2px 0 0; }
.settings-row select { min-height: 44px; font-size: 15px; max-width: 100%; }
.settings-actions { display: flex; gap: 8px; }

/* A short message over the page */
.app-toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(96px + env(safe-area-inset-bottom, 0px)); z-index: 1100;
  max-width: min(92vw, 480px); padding: 12px 18px; border-radius: 14px; background: var(--ink); color: var(--on-ink, #fff); font: 600 15px var(--f-body); box-shadow: var(--shadow); text-align: center; }
.app-toast[hidden] { display: none; }

/* Scribe: no language bar (languages are found automatically, or come from the appointment). */
.scribe-lang[hidden] { display: none !important; }
/* Procedure templates (Profile): the fields shrink to the screen (a phone was 25 px too narrow). */
.pt-row > *, .pt-field input, .pt-field textarea { min-width: 0; max-width: 100%; box-sizing: border-box; }
.pt-field input { width: 100%; }
@media (max-width: 480px) { .pt-row { grid-template-columns: minmax(0, 1fr) 92px; } }

/* Interpret: the language search (every layout); "Find the patient's language" is gone. */
#detect-panel[hidden] { display: none !important; }
.touch-mode #view-languages .search input { font-size: 18px; min-height: 56px; }
.touch-mode #view-languages .lang-tools { gap: 12px; }

/* Mobile Scribe page: compact patient cards. Line 1: time and name; line 2: visit type, place and
   language together; line 3: the buttons, one line each. */
html[data-layout="mobile"] .sched-pick .sched-row { grid-template-columns: 62px minmax(0, 1fr); gap: 6px 10px; padding: 10px 12px; border-width: 1.5px; border-radius: 14px; align-items: start; }
html[data-layout="mobile"] .sched-pick .sched-time { font-size: 14px; line-height: 24px; }
html[data-layout="mobile"] .sched-pick .sched-main { column-gap: 8px; row-gap: 3px; }
html[data-layout="mobile"] .sched-pick .sched-main b { font-size: 17px; line-height: 24px; }
html[data-layout="mobile"] .sched-pick .sched-who { font-size: 14px; }
html[data-layout="mobile"] .sched-pick .sched-meta { font-size: 13px; line-height: 1.3; }
html[data-layout="mobile"] .sched-pick .sched-lang-btn { min-height: 26px; padding: 1px 8px 1px 5px; gap: 4px; font-size: 13px; }
html[data-layout="mobile"] .sched-pick .sched-lang-btn img { width: 20px; height: 15px; }
html[data-layout="mobile"] .sched-pick .sched-actions { grid-column: 1 / -1; display: flex; flex-wrap: nowrap; gap: 6px; }
html[data-layout="mobile"] .sched-pick .sched-actions .btn { flex: 1 1 0; min-width: 0; min-height: 40px; padding: 6px 8px; font-size: 14.5px; white-space: nowrap; border-radius: 12px; }
html[data-layout="mobile"] .sched-pick .sched-actions .btn svg { width: 15px; height: 15px; margin-right: 4px; }
html[data-layout="mobile"] .sched-pick .sched-row { display: flex; flex-direction: column; gap: 7px; position: relative; }
html[data-layout="mobile"] .sched-pick .sched-time { position: absolute; top: 10px; left: 12px; }
html[data-layout="mobile"] .sched-pick .sched-name { padding-left: 72px; }
html[data-layout="mobile"] .sched-pick .sched-meta { flex: 0 1 auto; }
html[data-layout="mobile"] .sched-pick .sched-pick-head h2, html[data-layout="mobile"] #sched-pick-h { font-size: 22px; }
html[data-layout="mobile"] .sched-pick .sched-row { align-items: stretch; min-width: 0; }
html[data-layout="mobile"] .sched-pick .sched-main, html[data-layout="mobile"] .sched-pick .sched-actions { width: 100%; min-width: 0; }
html[data-layout="mobile"] .sched-pick .sched-actions .btn { overflow: hidden; text-overflow: ellipsis; }
html[data-layout="mobile"] .sched-pick .sched-actions { flex-wrap: wrap; }
html[data-layout="mobile"] .sched-pick .sched-actions .btn { flex: 1 0 auto; overflow: visible; }

/* Admin: a person's departments and locations (pick several) */
.dept-many { position: relative; }
.dept-many > summary { cursor: pointer; list-style: none; padding: 6px 28px 6px 10px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); min-width: 140px; max-width: 260px; font-size: 14px; position: relative; }
.dept-many > summary::-webkit-details-marker { display: none; }
.dept-many > summary::after { content: "▾"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.dept-pop { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 220px; max-height: 280px; overflow-y: auto; padding: 8px; background: var(--surface); border: 1.5px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.dept-pop label { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.dept-pop label:hover { background: var(--tint); }

/* Scribe page: the day's patients under a location heading (below the date) */
.sched-loc { list-style: none; display: flex; align-items: center; gap: 8px; margin: 10px 2px 2px; font: 700 15px var(--f-body); color: var(--ink); }
.sched-loc:first-child { margin-top: 0; }
.sched-loc svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.sched-loc small { color: var(--muted); font-weight: 500; font-size: 13px; }
/* Mobile: even shorter cards */
html[data-layout="mobile"] .sched-pick .sched-list { gap: 8px; }
html[data-layout="mobile"] .sched-pick .sched-row { padding: 8px 12px; gap: 5px; }
html[data-layout="mobile"] .sched-pick .sched-time { top: 8px; }
html[data-layout="mobile"] .sched-pick .sched-main b { font-size: 16.5px; line-height: 22px; }
html[data-layout="mobile"] .sched-pick .sched-time { line-height: 22px; }
html[data-layout="mobile"] .sched-pick .sched-main { row-gap: 2px; }
html[data-layout="mobile"] .sched-pick .sched-lang-btn { min-height: 24px; }
html[data-layout="mobile"] .sched-pick .sched-actions .btn { min-height: 36px; padding: 4px 8px; font-size: 14px; }
html[data-layout="mobile"] .sched-pick > .fine { display: none; }
/* (Opens inside the row: the table's scrolling box would cut off a floating list.) */
.dept-pop { position: static; margin-top: 6px; box-shadow: none; min-width: 0; }

/* athenaOne connection (admin console, athena-connect.js) */
.athc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 8px; }
.athc-settings { margin-top: 16px; }
