/* Upload, Settings and account pages in the practice app.
   Loaded after practice.css by those templates only. Uses the shell's
   tokens; the one strong moment is the visit verdict line. */

/* ----- upload form ------------------------------------------------------ */
.practice-shell .upload-card { border: 1px dashed var(--line-strong); }
.practice-shell .upload-card .stack-form { margin-top: 0; }
.practice-shell .upload-card label { font-weight: 600; }
.practice-shell .upload-card input[type="file"] { width: 100%; padding: .6rem; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); font: inherit; }
.practice-shell .upload-card .meta { margin: -.4rem 0 0; }
.practice-shell .upload-card .button { justify-self: start; }

.practice-shell .first-step { margin: 0 0 1rem; padding: .9rem 1rem; border: 1px solid var(--line-strong); border-left: 4px solid var(--ink); border-radius: 10px; background: var(--card); }

.practice-shell .files-next { margin: 2rem 0 1rem; }
.practice-shell .files-next h2 { margin: 0 0 .75rem; }
.practice-shell .file-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.practice-shell .file-steps li { position: relative; padding: 2.4rem 0 0; border-top: 2px solid var(--ink); counter-increment: step; color: #3d3d39; }
.practice-shell .file-steps li::before { content: counter(step); position: absolute; top: .6rem; left: 0; font-weight: 700; color: var(--ink); }
.practice-shell .file-steps strong { display: block; color: var(--ink); }

.practice-shell .file-links { display: grid; gap: .25rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.practice-shell .file-links li { display: grid; gap: 0; }
.practice-shell .file-links a { display: inline-flex; align-items: center; min-height: 44px; width: fit-content; font-weight: 600; }
.practice-shell .file-links .meta { margin-top: -.5rem; color: var(--muted); }
.practice-shell .other-files .meta:last-child { margin-bottom: 0; }
.practice-shell .file-format { margin-top: 1rem; }
.practice-shell .file-format h3 { margin: 1rem 0 .5rem; font-size: .9375rem; }
.practice-shell .file-format h3:first-child { margin-top: 0; }
.practice-shell .file-format p { max-width: 68ch; }
.practice-shell .file-format .column-list { color: var(--ink); font-size: .8125rem; }
.practice-shell .files-boundary { margin: 1rem 0 0; }
.practice-shell .files-back { margin: 1rem 0 0; }
.practice-shell .files-back a { display: inline-flex; align-items: center; min-height: 44px; }

/* ----- the verdict: "8 visits: 7 ready, 1 needs a fix" ------------------- */
.practice-shell .visit-verdict { margin: 0 0 1.5rem; padding: 1.25rem 0 0; border-top: 2px solid var(--ink); }
.practice-shell .verdict-line { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 500; letter-spacing: -.03em; line-height: 1.15; }
.practice-shell .verdict-ready { color: var(--success); }
.practice-shell .verdict-fix { color: var(--attention); }
.practice-shell .verdict-bar { display: flex; gap: 3px; height: 8px; margin: .9rem 0 0; max-width: 520px; }
.practice-shell .verdict-bar span { flex-basis: 0; border-radius: 99px; }
.practice-shell .bar-ready { background: var(--success); }
.practice-shell .bar-fix { background: var(--copper); }
.practice-shell .verdict-note, .practice-shell .next-line { max-width: 68ch; margin: .9rem 0 0; }
.practice-shell .verdict-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.1rem; }
.practice-shell .verdict-actions form { margin: 0; }
.practice-shell .visit-verdict .meta { margin: .75rem 0 0; }

/* ----- visit tables ------------------------------------------------------ */
.practice-shell .visit-table th[scope="row"] { color: var(--ink); font-size: .9375rem; font-weight: 600; letter-spacing: 0; text-transform: none; }
.practice-shell .visit-patient { display: block; }
.practice-shell .visit-ref { display: block; margin-top: .1rem; color: var(--muted); font-size: .8125rem; font-weight: 400; }
.practice-shell .visit-table td, .practice-shell .visit-table th { vertical-align: top; }
.practice-shell .visit-table .row-link { min-height: 0; font-weight: 600; text-decoration: underline; }
.practice-shell .visit-table tr.row-fix > * { background: var(--attention-soft); border-bottom: 0; }
.practice-shell .visit-table tr.row-fix + tr.visit-fix > td { background: var(--attention-soft); padding-top: 0; }
.practice-shell .fix-box { padding: .75rem 1rem; border-left: 3px solid var(--copper); background: #fff; border-radius: 0 8px 8px 0; }
.practice-shell .fix-title { margin: 0 0 .4rem; font-weight: 600; }
.practice-shell .fix-list { display: grid; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.practice-shell .fix-list li { max-width: 80ch; }
.practice-shell .fix-where { display: inline-block; margin-right: .5rem; padding: 0 .45rem; border-radius: 6px; background: var(--soft); font-size: .8125rem; font-weight: 600; }
.practice-shell .fix-problem { font-weight: 600; }
.practice-shell .fix-how { color: #3d3d39; }
.practice-shell .file-problems { padding: 1rem 1.25rem; }
.practice-shell .file-problems h2 { margin: 0 0 .5rem; font-size: 1.125rem; color: var(--danger); }
.practice-shell .file-problems .fix-how { color: var(--ink); }
.practice-shell .file-problems .form-actions { margin-top: 1rem; }
.practice-shell .row-counts { margin: 0 0 .75rem; }
.practice-shell .row-table th[scope="row"] { font-size: .875rem; }

/* ----- settings ---------------------------------------------------------- */
.practice-shell .settings-section .section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.practice-shell .settings-section .section-head h2 { margin: 0; }
.practice-shell .settings-list { display: grid; margin: 0; padding: 0 1.4rem; }
.practice-shell .settings-list > div { display: grid; grid-template-columns: minmax(10rem, 14rem) minmax(0, 1fr); gap: .25rem 1.5rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.practice-shell .settings-list > div:last-child { border-bottom: 0; }
.practice-shell .settings-list dt { color: var(--muted); font-size: .875rem; font-weight: 600; }
.practice-shell .settings-list dd { margin: 0; overflow-wrap: anywhere; }
.practice-shell .dd-note { display: block; margin-top: .2rem; color: #3d3d39; font-size: .875rem; }
.practice-shell .spend-meter { display: block; width: min(100%, 280px); height: 6px; margin-top: .5rem; border-radius: 99px; background: var(--soft); overflow: hidden; }
.practice-shell .spend-meter > span { display: block; height: 100%; background: var(--ink); }
.practice-shell .settings-note { margin: 1rem 1.4rem 0; padding: .75rem 1rem; border: 1px solid var(--attention-line); border-radius: 10px; color: var(--attention); background: var(--attention-soft); }
.practice-shell .source-list { margin: 0; padding: 0 1.4rem; list-style: none; }
.practice-shell .source-list > li { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.practice-shell .source-list > li:last-child { border-bottom: 0; }
.practice-shell .source-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.practice-shell .source-head h3 { margin: 0; font-size: 1rem; }
.practice-shell .source-list p { max-width: 72ch; margin: .35rem 0 0; }
.practice-shell .settings-section .audit-details { margin: 0 1.4rem 1.4rem; }
.practice-shell .settings-section .definition-grid { margin-top: 0; }
.practice-shell .settings-section .definition-grid dt { font-size: .8125rem; text-transform: none; letter-spacing: 0; }

/* ----- account pages ----------------------------------------------------- */
.practice-shell .practice-account { max-width: 30rem; margin: 1rem auto 0; }
.practice-shell .practice-account h1 { font-size: 2rem; }
.practice-shell .account-lede { margin: .5rem 0 0; color: #3d3d39; }
.practice-shell .practice-account .inline-notice { margin: 1rem 0 0; padding: .75rem 1rem; border: 1px solid var(--good-line); border-radius: 10px; color: var(--success); background: var(--success-soft); }
.practice-shell .practice-account .inline-notice.error { border-color: var(--problem-line); color: var(--danger); background: var(--danger-soft); }
.practice-shell .practice-account .stack-form label { font-weight: 600; margin-bottom: -.5rem; }
.practice-shell .practice-account .stack-form .meta { margin: -.5rem 0 0; }
.practice-shell .account-links ul { display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 1rem 0 0; padding: 0; list-style: none; }
.practice-shell .account-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* ----- phone ------------------------------------------------------------- */
@media (max-width: 760px) {
  .practice-shell .file-steps { grid-template-columns: 1fr; gap: .75rem; }
  .practice-shell .file-steps li { padding: .6rem 0 0 1.75rem; border-top-width: 1px; }
  .practice-shell .file-links a { width: auto; }
  .practice-shell .verdict-actions > *, .practice-shell .verdict-actions form .button { width: 100%; }
  .practice-shell .visit-table tr.visit-fix { padding-top: 0; }
  .practice-shell .visit-table tr.visit-fix > td { display: block; padding: 0; text-align: left; }
  .practice-shell .visit-table tr.row-fix { background: var(--attention-soft); border-bottom: 0; }
  .practice-shell .visit-table tr.row-fix + tr.visit-fix { background: var(--attention-soft); padding: 0 1rem .9rem; }
  .practice-shell .visit-table tr.row-fix > * { background: transparent; }
  .practice-shell .visit-table th[scope="row"] { display: block; padding-bottom: .3rem; }
  /* Visit lists: patient and result on one line, date, payer and amount under it. */
  .practice-shell .compact-on-phone tr:not(.visit-fix) { display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .75rem; }
  .practice-shell .compact-on-phone tr:not(.visit-fix) > th[scope="row"] { flex: 1 1 55%; padding: 0; }
  .practice-shell .compact-on-phone tr:not(.visit-fix) > td { display: block; flex: 0 0 auto; order: 2; padding: 0; color: #3d3d39; font-size: .875rem; text-align: left; }
  .practice-shell .compact-on-phone td[data-label]::before { content: none; }
  .practice-shell .compact-on-phone tr:not(.visit-fix) > td[data-label="Check"],
  .practice-shell .compact-on-phone tr:not(.visit-fix) > td[data-label="Result"] { order: 1; margin-left: auto; }
  .practice-shell .compact-on-phone .row-link { min-height: 44px; margin: -.6rem 0; }
  .practice-shell .compact-on-phone td.note-signed { display: none; }
  .practice-shell .compact-on-phone td.note-missing::before { content: "Signed note: "; }
  .practice-shell .visit-table td[data-label="What it means"] { display: block; text-align: left; }
  .practice-shell .visit-table td[data-label="What it means"]::before { display: block; margin-bottom: .15rem; }
  .practice-shell .settings-list, .practice-shell .source-list { padding: 0 1rem; }
  .practice-shell .settings-list > div { grid-template-columns: 1fr; }
  .practice-shell .settings-note { margin: 1rem 1rem 0; }
  .practice-shell .settings-section .audit-details { margin: 0 1rem 1rem; }
  .practice-shell .practice-account { margin-top: 0; padding: 1.25rem; }
  .practice-shell .practice-account h1 { font-size: 1.75rem; }
  .practice-shell .account-links ul { display: grid; gap: 0; }
}
