/* Practice app shell. Loaded after app.css only on practice pages
   (body.practice-shell). Same calm palette and black primary buttons;
   a smaller type scale, 12px floor, 44px tap targets and one header.
   Shared building blocks (_ui.html) are styled at the bottom. */

.practice-shell {
  --attention: #75411f;
  --attention-soft: var(--copper-soft);
  --attention-line: #dcb38f;
  --problem-line: #d8aaa5;
  --good-line: #a8c4b4;
  --shell-width: 1200px;
  --gutter: 1.5rem;
  font-size: 16px;
  line-height: 1.5;
}

/* ----- type scale: 40/28 titles, 12px floor ----------------------------- */
.practice-shell h1 { font-size: 2.5rem; line-height: 1.1; font-weight: 500; letter-spacing: -.035em; overflow-wrap: anywhere; }
.practice-shell h2 { font-size: 1.375rem; line-height: 1.2; font-weight: 600; letter-spacing: -.02em; }
.practice-shell h3 { font-size: 1.0625rem; line-height: 1.3; }
.practice-shell .lede { max-width: 68ch; font-size: 1.0625rem; line-height: 1.5; color: #3d3d39; }
.practice-shell .eyebrow { font-size: .8125rem; letter-spacing: 0; text-transform: none; font-weight: 600; }
.practice-shell .meta, .practice-shell .queue-details { font-size: .8125rem; }
.practice-shell .badge { min-height: 24px; font-size: .75rem; }
.practice-shell th,
.practice-shell .definition-grid dt,
.practice-shell .provenance-grid dt,
.practice-shell .evidence-kind,
.practice-shell .issue-code,
.practice-shell .artifact-label,
.practice-shell .payment-metrics dt,
.practice-shell .payment-summary span,
.practice-shell .lane-tag,
.practice-shell .money-strip span,
.practice-shell .timeline time,
.practice-shell .decision-grid strong { font-size: .75rem; letter-spacing: .02em; text-transform: none; }
.practice-shell table { font-size: .9375rem; }
.practice-shell .count-card strong { font-size: clamp(2rem, 4vw, 2.5rem); }
.practice-shell .count-card { min-height: 0; padding: 1.1rem 1.25rem; }
.practice-shell .payment-checkout-head h2 { font-size: 1.5rem; }
.practice-shell .site-footer { font-size: .8125rem; }

/* ----- spacing ---------------------------------------------------------- */
.practice-shell main { max-width: var(--shell-width); padding: 2rem var(--gutter) 4rem; }
.practice-shell main.narrow { max-width: 820px; }
.practice-shell .card-body { padding: 1.25rem 1.4rem; }
.practice-shell .section-head { padding: 1rem 1.4rem; }
.practice-shell .queue-item { padding: 1rem 1.4rem; }
.practice-shell .count-grid { margin-bottom: 1.5rem; }
.practice-shell .card + .card,
.practice-shell section + section.card,
.practice-shell .detail-grid { margin-top: 1rem; }
.practice-shell .page-head { align-items: flex-end; margin-bottom: 1.5rem; }
.practice-shell .page-head .lede { margin-top: .5rem; }
/* The old centered hero becomes an ordinary page header. */
.practice-shell .today-hero { display: block; min-height: 0; padding: 0 0 1.5rem; text-align: left; }
.practice-shell .today-hero .eyebrow { margin-top: 0; }
.practice-shell .today-hero .lede { margin: .5rem 0 0; }
.practice-shell .today-hero .page-actions { justify-content: flex-start; margin-top: 1rem; }

/* ----- controls: 44px targets, visible focus ---------------------------- */
.practice-shell :focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.practice-shell .button { min-height: 44px; padding: .55rem 1.1rem; }
.practice-shell .button.secondary { border-color: var(--line-strong); }
.practice-shell input, .practice-shell select, .practice-shell textarea { min-height: 44px; }
.practice-shell textarea { min-height: 88px; }
.practice-shell .text-action, .practice-shell .link-button { min-height: 44px; }
.practice-shell a:focus-visible, .practice-shell button:focus-visible, .practice-shell summary:focus-visible { outline-offset: 2px; }

/* ----- header ------------------------------------------------------------ */
.shell-topbar { position: relative; z-index: 20; background: #fff; }
.shell-topbar .topbar-inner { max-width: var(--shell-width); min-height: 64px; padding: .5rem var(--gutter); gap: 1.25rem; }
.shell-topbar .brand { font-size: 1.125rem; }
.shell-topbar .workspace-line { max-width: var(--shell-width); padding: 0 var(--gutter) .5rem; font-size: .8125rem; }
.shell-nav { display: flex; align-items: center; gap: .25rem; margin: 0 auto 0 1rem; }
.shell-nav a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: 0 .85rem; border-radius: 99px; color: #343431; font-weight: 500; text-decoration: none; white-space: nowrap; }
.shell-nav a:hover { color: var(--ink); background: var(--soft); }
.shell-nav a[aria-current="page"] { color: var(--ink); background: var(--soft); font-weight: 700; }
.count-badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 .4rem; border-radius: 99px; color: #fff; background: var(--copper); font-size: .75rem; font-weight: 700; line-height: 1; }
.shell-menu-toggle { display: none; }

.account-menu { position: relative; margin-left: auto; }
.account-menu > summary { display: flex; align-items: center; gap: .55rem; min-height: 44px; padding: .25rem .6rem .25rem .3rem; border: 1px solid var(--line); border-radius: 99px; background: #fff; cursor: pointer; list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary::after { content: ""; width: 7px; height: 7px; margin: 0 .2rem 0 .1rem; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); }
.account-menu[open] > summary { border-color: var(--ink); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; color: #fff; background: var(--ink); font-size: .875rem; font-weight: 700; }
.account-name { max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; font-weight: 600; }
.account-panel { position: absolute; right: 0; top: calc(100% + .5rem); z-index: 30; display: grid; min-width: 250px; padding: .5rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(8, 8, 8, .12); }
.account-who { display: grid; gap: .1rem; margin: 0 0 .35rem; padding: .5rem .75rem .75rem; border-bottom: 1px solid var(--line); }
.account-who span { color: var(--muted); font-size: .8125rem; }
.account-panel a, .account-signout { display: flex; align-items: center; width: 100%; min-height: 44px; padding: 0 .75rem; border: 0; border-radius: 8px; color: var(--ink); background: transparent; text-align: left; text-decoration: none; font-weight: 500; cursor: pointer; }
.account-panel a:hover, .account-signout:hover, .account-panel a[aria-current="page"] { background: var(--soft); }
.account-panel form { margin: 0; }

/* ----- building blocks (_ui.html) --------------------------------------- */
.shell-page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.shell-page-head .lede { margin-top: .5rem; }

.pill { display: inline-flex; align-items: center; gap: .4rem; min-height: 26px; padding: .15rem .65rem; border-radius: 99px; font-size: .8125rem; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; }
.pill-neutral { color: #3d3d39; background: var(--soft); }
.pill-good { color: var(--success); background: var(--success-soft); }
.pill-attention { color: var(--attention); background: var(--attention-soft); }
.pill-problem { color: var(--danger); background: var(--danger-soft); }

.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-empty { color: var(--muted); }
.num { text-align: right; }
.practice-shell th.num { text-align: right; }

.claim-summary { display: grid; grid-template-columns: repeat(5, minmax(0, auto)); justify-content: start; gap: .5rem 2rem; margin: 0; }
.claim-summary dt { color: var(--muted); font-size: .8125rem; }
.claim-summary dd { margin: .1rem 0 0; font-weight: 600; overflow-wrap: anywhere; }

.progress-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); list-style: none; margin: 0; padding: 0; counter-reset: none; }
.progress-strip li { position: relative; display: grid; gap: .15rem; padding: 1.4rem .5rem 0 0; color: var(--muted); font-size: .875rem; }
.progress-strip li::before { content: ""; position: absolute; top: 6px; left: 14px; right: 0; height: 2px; background: var(--line); }
.progress-strip li:last-child::before { display: none; }
.progress-strip .step-dot { position: absolute; top: 0; left: 0; width: 14px; height: 14px; border: 2px solid var(--line-strong); border-radius: 50%; background: #fff; }
.progress-strip .step-when { font-size: .8125rem; }
.progress-strip .step-done { color: var(--ink); }
.progress-strip .step-done::before { background: var(--ink); }
.progress-strip .step-done .step-dot { border-color: var(--ink); background: var(--ink); }
.progress-strip .step-current { color: var(--ink); font-weight: 700; }
.progress-strip .step-current .step-dot { border-color: var(--ink); box-shadow: inset 0 0 0 3px #fff; background: var(--ink); }
.progress-strip .step-problem { color: var(--danger); font-weight: 700; }
.progress-strip .step-problem .step-dot { border-color: var(--danger); background: var(--danger); }

.audit-details { margin-top: 1.5rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.audit-details > summary { display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: .5rem 1.25rem; color: var(--muted); font-weight: 600; cursor: pointer; list-style: none; }
.audit-details > summary::-webkit-details-marker { display: none; }
.audit-details > summary::after { content: "+"; font-size: 1.25rem; font-weight: 400; }
.audit-details[open] > summary { color: var(--ink); border-bottom: 1px solid var(--line); }
.audit-details[open] > summary::after { content: "−"; }
.audit-details-body { padding: 1rem 1.25rem 1.25rem; overflow-wrap: anywhere; font-size: .875rem; }
.audit-details-body code { font: .8125rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

.empty-state { display: grid; justify-items: start; gap: .75rem; padding: 1.5rem 1.4rem; color: var(--muted); }
.empty-state p { margin: 0; max-width: 60ch; }

.claims-table th[scope="row"] { color: var(--ink); font-size: .9375rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.claims-table td, .claims-table th { vertical-align: middle; }
.row-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); text-decoration: none; }
.row-link:hover { text-decoration: underline; }

.error-page { padding: 2rem 0; }
.error-page .page-actions { margin-top: 1.5rem; }

.practice-shell .notice { color: var(--success); }
.practice-shell .notice.warning, .practice-shell .notice.attention { color: var(--attention); border-color: var(--attention-line); background: var(--attention-soft); }
.practice-shell .inline-notice.error, .practice-shell [role="alert"].notice { color: var(--danger); border-color: var(--problem-line); background: var(--danger-soft); }

/* ----- tablet ------------------------------------------------------------ */
@media (max-width: 1080px) {
  .shell-nav { margin-left: .25rem; }
  .shell-nav a { padding: 0 .6rem; }
  .account-name { display: none; }
  .account-menu > summary { padding-right: .5rem; }
}

@media (max-width: 900px) {
  .practice-shell .topbar-inner { flex-wrap: nowrap; }
  .claim-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ----- phone: collapsing nav, 28px titles, no sideways scroll ----------- */
@media (max-width: 760px) {
  .practice-shell { --gutter: 1rem; }
  .practice-shell h1 { font-size: 1.75rem; }
  .practice-shell h2 { font-size: 1.1875rem; }
  .practice-shell main { padding-top: 1.25rem; }
  .shell-topbar .topbar-inner { flex-wrap: wrap; gap: .5rem; min-height: 56px; }
  .shell-menu-toggle { display: none; }
  .js .shell-menu-toggle { display: inline-flex; align-items: center; min-height: 44px; margin-left: auto; padding: 0 1rem; border: 1px solid var(--line-strong); border-radius: 99px; color: var(--ink); background: #fff; font-weight: 600; cursor: pointer; }
  .js .shell-menu-toggle[aria-expanded="true"] { border-color: var(--ink); }
  .js .account-menu { margin-left: 0; }
  .account-menu { margin-left: auto; }
  .shell-nav { order: 5; flex-wrap: wrap; width: 100%; margin: 0; gap: .25rem; }
  .js .shell-nav { display: none; flex-direction: column; align-items: stretch; padding: .25rem 0 .5rem; }
  .js .shell-nav.open { display: flex; }
  .js .shell-nav a { justify-content: space-between; min-height: 48px; padding: 0 .75rem; border-radius: 10px; }
  .account-panel { right: 0; min-width: min(250px, calc(100vw - 2rem)); }
  .practice-shell .page-head, .shell-page-head { flex-direction: column; align-items: flex-start; }
  .progress-strip { grid-template-columns: 1fr; gap: 0; }
  .progress-strip li { grid-template-columns: 1fr auto; padding: 0 0 .9rem 1.75rem; }
  .progress-strip li::before { top: 16px; bottom: 0; left: 6px; right: auto; width: 2px; height: auto; }
  .progress-strip .step-dot { top: 3px; }
  .claim-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem 1rem; }
  /* Tables marked stack-on-phone read as one card per row. */
  .practice-shell .stack-on-phone { display: block; min-width: 0; }
  .practice-shell .stack-on-phone thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .practice-shell .stack-on-phone tbody, .practice-shell .stack-on-phone tr { display: block; }
  .practice-shell .stack-on-phone tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
  .practice-shell .stack-on-phone tr:last-child { border-bottom: 0; }
  .practice-shell .stack-on-phone td, .practice-shell .stack-on-phone th[scope="row"] { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; border: 0; text-align: right; }
  .practice-shell .stack-on-phone th[scope="row"] { text-align: left; }
  .practice-shell .stack-on-phone td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8125rem; text-align: left; }
  .practice-shell .table-wrap:has(.stack-on-phone) { overflow: visible; }
  .practice-shell .button { width: auto; }
  .practice-shell .page-actions { width: 100%; }
  .practice-shell .page-actions .button, .practice-shell .form-actions .button { flex: 1 1 auto; }
}

@media (max-width: 380px) {
  .claim-summary { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .practice-shell * { transition: none !important; }
}

/* ----- fixes found in the screenshot review ----------------------------- */
/* Work-page notices were light grey text on paper; make them a status line. */
.practice-shell .dept-honesty { max-width: none; margin: 0 0 1rem; padding: .75rem 1rem; color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-left: 4px solid var(--ink); border-radius: 10px; font-size: .9375rem; }
.practice-shell .site-footer { max-width: calc(var(--shell-width) - 2 * var(--gutter)); padding-left: 0; padding-right: 0; }
@media (max-width: 1248px) { .practice-shell .site-footer { margin-left: var(--gutter); margin-right: var(--gutter); } }
.practice-shell tbody th { border-bottom: 1px solid var(--line); }
.practice-shell tbody tr:last-child th { border-bottom: 0; }
.shell-menu-toggle .count-badge { margin-left: .4rem; }
.practice-shell .stack-on-phone td[data-label]::before { flex: 0 0 auto; }

@media (max-width: 760px) {
  /* Claims: patient and status on one line, date and amount under it. */
  .practice-shell .claims-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .1rem .75rem; align-items: center; }
  .practice-shell .claims-table th[scope="row"], .practice-shell .claims-table td { display: block; padding: 0; text-align: left; }
  .practice-shell .claims-table td[data-label]::before { content: none; }
  .practice-shell .claims-table th[scope="row"] { grid-column: 1; grid-row: 1; }
  .practice-shell .claims-table td[data-label="Status"] { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .25rem; }
  .practice-shell .claims-table td[data-label="Visit date"] { grid-column: 1; grid-row: 2; color: var(--muted); font-size: .875rem; }
  .practice-shell .claims-table td[data-label="Amount"] { grid-column: 2; grid-row: 2; text-align: right; font-size: .875rem; }
  .practice-shell .claims-table td[data-label="Next step"] { grid-column: 1 / -1; grid-row: 3; margin-top: .25rem; color: #3d3d39; font-size: .875rem; }
}
.practice-shell .detail-grid > .card, .practice-shell .layout > .card { margin-top: 0; }

/* ----- Today and Payments ------------------------------------------------ */
/* Tiles: one ruled row of plain numbers. Amber only when a person is needed. */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 1.5rem; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.tiles-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tile { display: flex; flex-direction: column; gap: .2rem; min-width: 0; margin: 0; padding: 1.1rem 1.25rem 1.2rem; border-left: 1px solid var(--line); }
.tile:first-child { border-left: 0; }
.tile dt { color: #3d3d39; font-size: .875rem; font-weight: 600; }
.tile dd { margin: 0; }
.tile .tile-value { order: 2; margin-top: .35rem; font-size: 2.25rem; line-height: 1.05; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .tile-value .money { white-space: normal; }
.tile .tile-value .badge { vertical-align: middle; letter-spacing: 0; }
.tile .tile-note { order: 4; color: var(--muted); font-size: .8125rem; }
.tile .tile-meter { order: 3; margin: .5rem 0 .25rem; }
.tile-attention { background: var(--attention-soft); }
.tile-attention .tile-value, .tile-attention dt { color: var(--attention); }
.tile-attention .tile-note a { color: var(--attention); font-weight: 600; }
.meter { display: block; height: 8px; border-radius: 99px; background: var(--soft); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.meter > span { display: block; height: 100%; min-width: 4px; border-radius: 99px; background: var(--success); }

.today-date { color: var(--ink); font-weight: 600; }
.practice-shell .live-status { margin: -.75rem 0 1.25rem; font-size: .8125rem; }
.section-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-size: .875rem; font-weight: 600; }
.section-note { margin: 0; padding: .85rem 1.4rem; color: #3d3d39; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.quiet-links { margin: 1.25rem 0 0; color: var(--muted); font-size: .875rem; }
.quiet-links a { color: #3d3d39; }

/* Needs you: the claim first, the reason under it, one quiet button. */
.needs-card { border-color: var(--attention-line); }
.needs-card .section-head { background: var(--attention-soft); }
.needs-card .section-head h2 { color: var(--attention); }
.needs-list { margin: 0; padding: 0; list-style: none; }
.needs-list li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.4rem; border-bottom: 1px solid var(--line); }
.needs-list li:last-child { border-bottom: 0; }
.needs-text { display: grid; gap: .15rem; min-width: 0; }
.needs-title { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.needs-title:hover { text-decoration: underline; }
.needs-reason { color: var(--muted); font-size: .875rem; }
.needs-state { color: var(--attention); font-weight: 600; }
.practice-shell .needs-action { flex: 0 0 auto; }

/* Payments */
.payments-caution { margin: 0 0 1rem; color: #3d3d39; font-size: .9375rem; }
.payments-table th[scope="row"] { color: var(--ink); font-size: .9375rem; font-weight: 600; letter-spacing: 0; }
.payments-table td, .payments-table th { vertical-align: middle; }
.payments-table td[data-label="Next step"] { min-width: 16ch; color: #3d3d39; }
.unmatched-card { border-color: var(--attention-line); }
.audit-table { font-size: .8125rem; }
.audit-table th, .audit-table td { vertical-align: top; }

@media (max-width: 900px) {
  .tiles, .tiles-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { border-left: 0; border-top: 1px solid var(--line); }
  .tile:nth-child(-n+2) { border-top: 0; }
  .tile:nth-child(even) { border-left: 1px solid var(--line); }
  .tiles-five .tile:last-child { grid-column: 1 / -1; border-left: 0; }
}

@media (max-width: 760px) {
  .tile { padding: .9rem 1rem 1rem; }
  .tile .tile-value { font-size: 1.75rem; }
  .needs-list li { align-items: flex-start; flex-direction: column; gap: .5rem; padding: .85rem 1rem; }
  .practice-shell .needs-action { display: none; }
  .section-note { padding: .75rem 1rem; }
  /* Payments: patient and status on one line, the money under it. */
  .practice-shell .payments-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; align-items: center; }
  .practice-shell .payments-table th[scope="row"] { grid-column: 1; text-align: left; }
  .practice-shell .payments-table td[data-label="Status"] { grid-column: 2; grid-row: 1; justify-content: flex-end; }
  .practice-shell .payments-table td[data-label="Next step"] { grid-column: 1 / -1; display: block; margin-top: .25rem; text-align: left; font-size: .875rem; }
  .practice-shell .payments-table td[data-label="Next step"]::before { content: none; }
  .practice-shell .payments-table td.num, .practice-shell .payments-table td[data-label="Visit date"] { grid-column: 1 / -1; }
  .practice-shell .unmatched-table th[scope="row"] { grid-column: 1 / -1; }
  .practice-shell .payments-table td[data-label="Status"]::before { content: none; }
  .practice-shell .payments-table td.num { justify-content: flex-end; gap: .4rem; }
  .practice-shell .payments-table td.num::before { margin-right: auto; }
}
