:root {
  --ink: #1d2733; --muted: #5f6b7a; --line: #d9dee5; --bg: #f5f7fa; --card: #fff;
  --brand: #12507b; --brand-ink: #fff; --ok: #1f7a4d; --warn: #9a5b00; --bad: #a12a2a;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
.top { display: flex; align-items: center; gap: 24px; padding: 10px 20px; background: var(--brand); color: var(--brand-ink); flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; }
.brand span { font-weight: 400; opacity: .85; margin-left: 6px; }
.top nav { display: flex; gap: 16px; }
.top nav a { color: var(--brand-ink); text-decoration: none; opacity: .9; }
.top nav a:hover { text-decoration: underline; }
.who { margin-left: auto; display: flex; gap: 10px; align-items: center; }
main { max-width: 1150px; margin: 0 auto; padding: 20px 16px 40px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 16px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.warn { color: var(--warn); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; margin: 12px 0; }
.list { list-style: none; padding: 0; margin: 0; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.plain li:last-child { border-bottom: 0; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.actions.wrap { flex-wrap: wrap; }
.flag { border-left: 4px solid var(--warn); }
.flag.k-correction_requested, .flag.k-conflict, .flag.k-hospitalized { border-left-color: var(--bad); }
.flag.k-overdue { border-left-color: var(--brand); }
.linker { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
button { font: inherit; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--brand); background: var(--card); color: var(--brand); cursor: pointer; }
button.primary { background: var(--brand); color: var(--brand-ink); }
button.secondary { border-color: var(--line); color: var(--ink); }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link { text-align: left; border: 0; padding: 0; background: none; color: var(--brand); text-decoration: underline; }
.small-btn { padding: 2px 8px; font-size: 13px; margin-left: 6px; }
.top button.secondary { color: var(--brand-ink); border-color: rgba(255,255,255,.5); background: transparent; }
input[type=text], input[type=email], input[type=datetime-local], input[type=date], input[type=time], select { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
input[type=text] { min-width: 240px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; background: #e8eef5; color: var(--brand); white-space: nowrap; }
.pill.s-change_requested, .pill.s-unreachable, .pill.s-cancelled { background: #fbeaea; color: var(--bad); }
.pill.s-scheduled, .pill.s-seen { background: #e6f4ec; color: var(--ok); }
.pill.s-closed { background: #eceff3; color: var(--muted); }
.badge { display: inline-block; min-width: 22px; text-align: center; padding: 0 6px; border-radius: 999px; background: var(--warn); color: #fff; font-size: 12px; }
.tag { display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 4px; background: #eef1f5; font-size: 12px; color: var(--muted); }
.tag.warn { background: #fff3df; color: var(--warn); }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.tabs a { padding: 6px 14px; border-radius: 6px; text-decoration: none; background: #e8eef5; }
.tabs a.active { background: var(--brand); color: var(--brand-ink); }
table.grid { width: 100%; border-collapse: collapse; background: var(--card); }
.grid th, .grid td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid th { font-size: 13px; color: var(--muted); font-weight: 600; }
.grid tr.low td { background: #fff6e5; }
.grid tr.dup td { color: var(--muted); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.correction { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 8px; }
.correction:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.timeline { list-style: none; padding: 0; margin: 0; }
.tl { padding: 6px 0 6px 12px; border-left: 3px solid var(--line); margin-left: 4px; }
.tl.event { border-left-color: var(--brand); }
.tl.event.reverted { opacity: .55; text-decoration: line-through; }
.tl.message.r-agency { border-left-color: #8a6bbf; }
.tl.message.r-medora_staff { border-left-color: var(--ok); }
details summary { cursor: pointer; }
pre.body { white-space: pre-wrap; font: inherit; background: #f8f9fb; border: 1px solid var(--line); border-radius: 6px; padding: 10px; margin: 8px 0; }
.notice { padding: 10px 14px; border-radius: 6px; margin-bottom: 10px; }
.notice.error { background: #fbeaea; color: var(--bad); }
.notice.ok { background: #e6f4ec; color: var(--ok); }
@media (max-width: 700px) {
  .grid thead { display: none; }
  .grid td { display: block; border: 0; padding: 2px 8px; }
  .grid tr { display: block; border-bottom: 1px solid var(--line); padding: 6px 0; }
  input[type=text] { min-width: 0; width: 100%; }
}
.resolution { background: #f3f6f9; border-radius: 6px; padding: 8px 10px; margin: 8px 0; }
[hidden] { display: none !important; }

/* Medora staff portal visual refresh. No external assets. */
:root { --ink:#263e49; --muted:#607681; --line:#dce7e8; --bg:#f3f7f7; --card:#ffffff; --brand:#235c67; --brand-ink:#fff; --ok:#236b55; --warn:#98651e; --bad:#a34141; }
body {line-height:1.55;letter-spacing:.005em;}
.top {background:#fff;color:var(--ink);border-bottom:1px solid var(--line);padding:16px max(20px,calc((100vw - 1190px)/2));gap:20px;box-shadow:0 3px 20px #263e4908;}
.brand {display:flex;align-items:center;gap:12px;font-size:17px;line-height:1.2;}
.brand-copy {display:flex;flex-direction:column;gap:3px;}
.brand-copy span {margin:0;color:var(--muted);font-size:12px;font-weight:500;opacity:1;letter-spacing:.05em;}
.top nav {flex-wrap:wrap;gap:6px;}
.top nav a {color:var(--ink);opacity:1;padding:9px 13px;border-radius:9px;font-size:14px;font-weight:600;}
.top nav a:hover,.top nav a:focus-visible {background:#eaf3f3;text-decoration:none;}
.top button.secondary {color:var(--brand);border-color:var(--line);}
main {max-width:1190px;padding:30px 20px 64px;}
h1 {font-size:clamp(24px,3vw,32px);font-weight:720;letter-spacing:-.035em;margin-bottom:16px;}
h2 {font-size:18px;letter-spacing:-.02em;}
.card {border-radius:14px;padding:20px 22px;margin:14px 0;box-shadow:0 4px 18px #263e4907;}
button {border-radius:9px;padding:9px 14px;font-weight:600;min-height:38px;}
button:hover:not(:disabled) {filter:brightness(.95);}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {outline:3px solid #8dbbc0;outline-offset:2px;}
input[type=text],input[type=email],input[type=datetime-local],input[type=date],input[type=time],select {padding:9px 11px;border-radius:9px;max-width:100%;min-height:38px;}
.actions {flex-wrap:wrap;align-items:center;}
.pill {padding:4px 11px;font-weight:600;background:#e6f1f2;}
.flag {border-left-width:4px;}
.grid th,.grid td {padding:12px 11px;}
.grid th {background:#f5f9f9;letter-spacing:.025em;}
.kv {gap:9px 22px;}
.notice {padding:14px 16px;border-radius:10px;}
.proposal-email {border:1px solid var(--line);border-radius:12px;padding:17px;margin:14px 0;background:#fcfefe;}
.proposal-email-header {display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-bottom:10px;}
.proposal-item {padding:13px 0;border-top:1px solid var(--line);}
.proposal-explanation {margin:5px 0 10px;overflow-wrap:anywhere;}
.proposal-controls {display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.proposal-controls button {min-width:75px;}
.proposal-skip {background:#fff;border-color:#cbd9dc;color:var(--muted);}
.foot {max-width:900px;margin:auto;padding:24px 20px 36px;line-height:1.6;}
@media(max-width:700px) {
 .top {padding:14px 16px;gap:14px;}
 .top nav {order:3;width:100%;overflow-x:auto;flex-wrap:nowrap;}
 .top nav a {white-space:nowrap;padding:9px 10px;}
 .who {margin-left:0;}
 main {padding:20px 12px 40px;}
 .card {padding:16px;}
 .kv {grid-template-columns:1fr;gap:2px;}
 .kv dd {margin-bottom:9px;overflow-wrap:anywhere;}
 .grid {display:block;overflow-x:auto;}
 .grid td {overflow-wrap:anywhere;}
 .actions button {max-width:100%;}
 .proposal-email {padding:12px;}
}

/* Apple-inspired, system-native visual language */
:root { --ink:#1d1d1f; --muted:#6e6e73; --line:#e5e5ea; --bg:#f5f5f7; --card:#fff; --brand:#007aff; --brand-ink:#fff; --ok:#248a3d; --warn:#9a6700; --bad:#d70015; }
body {font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:15px;line-height:1.48;letter-spacing:-.01em;-webkit-font-smoothing:antialiased;}
.top {background:#ffffffed;box-shadow:none;border-bottom:1px solid #e5e5ea;padding-top:12px;padding-bottom:12px;}
.brand-copy span {font-size:12px;letter-spacing:0;}
.top nav a {font-weight:500;border-radius:9px;}
.top nav a:hover,.top nav a:focus-visible {background:#f2f2f7;}
main {max-width:1080px;}
h1 {font-size:clamp(28px,3.3vw,36px);font-weight:700;letter-spacing:-.045em;}
h2 {font-size:18px;font-weight:650;}
.card {border:1px solid #e9e9ed;border-radius:16px;box-shadow:0 2px 8px #00000005;padding:20px 22px;}
button {background:#f2f2f7;border:1px solid transparent;color:#007aff;border-radius:10px;min-height:36px;padding:8px 14px;font-weight:600;transition:background .15s ease,transform .15s ease;}
button.primary {background:#007aff;color:#fff;}
button.secondary {background:#f2f2f7;border-color:transparent;color:#007aff;}
button:hover:not(:disabled) {filter:none;background:#e5e5ea;}
button.primary:hover:not(:disabled) {background:#0068db;}
button:active:not(:disabled) {transform:scale(.985);}
input[type=text],input[type=email],input[type=datetime-local],input[type=date],input[type=time],select {background:#f7f7f9;border:1px solid #e5e5ea;border-radius:10px;}
input[type=checkbox] {appearance:none;-webkit-appearance:none;position:relative;display:inline-block;vertical-align:middle;width:43px;height:26px;min-width:43px;border-radius:999px;background:#e9e9eb;border:1px solid #d1d1d6;cursor:pointer;margin:0 8px 0 0;transition:background .18s ease;}
input[type=checkbox]::after {content:"";position:absolute;left:2px;top:2px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 1px 3px #0003;transition:transform .18s ease;}
input[type=checkbox]:checked {background:#34c759;border-color:#34c759;}
input[type=checkbox]:checked::after {transform:translateX(17px);}
input[type=checkbox]:focus-visible {outline:3px solid #88baff;outline-offset:3px;}
.grid th {background:#fafafa;color:#86868b;font-size:12px;font-weight:600;}
.grid th,.grid td {border-bottom:1px solid #ededf0;}
.pill {background:#eef2f8;color:#42617d;font-weight:600;}
.pill.s-scheduled,.pill.s-seen {background:#e7f7eb;color:#248a3d;}
.tabs a {background:#e9e9ed;border-radius:9px;color:#4b4b50;}
.tabs a.active {background:#fff;color:#1d1d1f;box-shadow:0 1px 4px #0002;}
.proposal-email {background:#fff;border:1px solid #e5e5ea;border-radius:16px;padding:18px 20px;}
.proposal-email-header {padding-bottom:8px;}
.proposal-item {padding:14px 0;border-top:1px solid #f0f0f2;}
.proposal-explanation {line-height:1.6;}
.proposal-skip {background:#f2f2f7;color:#6e6e73;}
.notice.ok {background:#e9f8ed;color:#248a3d;}
.notice.error {background:#fff0f0;color:#b42332;}
@media(max-width:700px) {.top {padding:12px 16px;} .card {border-radius:14px;padding:16px;} .proposal-email {padding:14px;} }

/* macOS-style workspace shell. Existing route IDs and hrefs are preserved. */
@media (min-width: 850px) {
  body {display:grid;grid-template-columns:246px minmax(0,1fr);grid-template-rows:minmax(100vh,auto) auto;align-items:start;background:#f5f5f7;}
  .top {grid-column:1;grid-row:1 / 3;position:sticky;top:0;height:100vh;min-height:580px;display:flex;flex-direction:column;align-items:stretch;gap:26px;padding:30px 14px 18px;background:#ececf1;border-right:1px solid #d9d9df;border-bottom:0;box-shadow:none;}
  .brand {display:flex;align-items:center;gap:10px;padding:0 9px;font-size:14px;line-height:1.2;min-height:56px;}
  .brand span {margin-left:0;}
  .brand-copy {display:flex;flex-direction:column;gap:4px;}
  .brand-copy span {font-size:11px;color:#74747b;opacity:1;}
  .top nav {display:flex;flex-direction:column;gap:3px;width:100%;}
  .top nav a {display:flex;align-items:center;gap:12px;min-height:39px;padding:9px 12px;border-radius:9px;color:#33343a;font-size:14px;opacity:1;text-decoration:none;}
  .top nav a.active,.top nav a[aria-current=page] {background:#dce6f6;color:#1858a9;font-weight:650;}
  .top nav a:hover {background:#e0e0e6;text-decoration:none;}
  .nav-symbol {display:inline-flex;align-items:center;justify-content:center;width:19px;height:19px;color:#69727e;font-size:18px;}
  .who {margin:auto 0 0;padding:15px 9px 0;border-top:1px solid #d7d7df;display:flex;align-items:flex-start;flex-direction:column;gap:10px;font-size:12px;overflow-wrap:anywhere;}
  main {grid-column:2;grid-row:1;max-width:1150px;width:100%;padding:36px clamp(20px,4vw,60px) 60px;margin:0 auto;}
  .foot {grid-column:2;grid-row:2;padding:20px 32px 30px;max-width:1050px;margin:auto;}
}
@media (max-width:849px) {
  .top {position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:12px;background:#f7f7fa;border-bottom:1px solid #e2e2e7;}
  .brand {display:flex;align-items:center;gap:9px;}
  .brand span {margin-left:0;}
  .brand-copy {display:flex;flex-direction:column;gap:2px;font-size:14px;}
  .top nav {display:flex;gap:5px;flex-wrap:nowrap;overflow-x:auto;width:100%;order:3;padding-bottom:3px;}
  .top nav a {display:inline-flex;align-items:center;gap:5px;white-space:nowrap;padding:9px 12px;border-radius:10px;color:#4a4a52;text-decoration:none;}
  .top nav a.active,.top nav a[aria-current=page] {background:#dce6f6;color:#1858a9;font-weight:650;}
  .nav-symbol {font-size:14px;}
  .who {margin-left:auto;font-size:12px;}
}

/* Email text above its suggestions (imported referrals). */
.proposal-quote {margin:4px 0 10px;padding:10px 14px;border-left:3px solid #d1d1d6;background:#f7f7f9;border-radius:8px;white-space:pre-wrap;overflow-wrap:anywhere;color:#3a3a3c;font-size:14px;}
.proposal-controls {margin-top:6px;}

/* Phone: each table row is one compact block (fields stacked inside it). */
@media (max-width: 700px) {
  table.grid { display: block; width: 100%; overflow: visible; background: transparent; }
  .grid tbody { display: block; width: 100%; }
  .grid tr { display: block; width: 100%; padding: 10px 4px; border-bottom: 1px solid #ededf0; }
  .grid th, .grid td { display: block; border: 0; padding: 1px 4px; }
  .grid tr.low { background: #fff6e5; border-radius: 10px; margin: 4px 0; }
  .grid tr.low td { background: transparent; }
}

/* Official Medora Health Group logo on a white tile (its own background is white). */
.brand { flex-direction: column; align-items: flex-start; gap: 6px; }
.brand-logo { display: block; background: #fff; border-radius: 12px; padding: 10px 12px; box-shadow: 0 1px 2px #0000000f; }
.brand-logo img { display: block; width: 176px; max-width: 100%; height: auto; }
.brand-sub { font-size: 11px; font-weight: 500; color: #74747b; padding-left: 4px; letter-spacing: 0; }
@media (min-width: 850px) { .brand { padding: 0 4px; min-height: 0; } .brand-logo { width: 100%; } .brand-logo img { width: 100%; } }
@media (max-width: 849px) { .brand { flex-direction: row; align-items: center; gap: 8px; } .brand-logo { padding: 6px 8px; border-radius: 10px; } .brand-logo img { width: 128px; } .brand-sub { display: none; } }
