/* MPDM client portal. Tokens from design rule 11.1. Light only. No third-party requests: fonts are served from /static/fonts. */
@font-face { font-family: "Archivo"; src: url("/static/fonts/Archivo-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo"; src: url("/static/fonts/Archivo-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Archivo Expanded"; src: url("/static/fonts/ArchivoExpanded-SemiBold.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }

:root {
  --bg: #F7F7F8; --surface: #FFFFFF; --ink: #101418; --muted: #565B62; --line: #DFE2E5;
  --accent: #C05A21; --accent-ink: #FFFFFF; --link: #8A3E14; --focus: #1F5FBF;
  --gap: 16px; --radius: 10px;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --head: "Archivo", "Archivo Expanded", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--body); }
h1, h2, h3, .wordmark { font-family: var(--head); font-weight: 500; line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 26px; }
h2 { font-size: 17px; font-weight: 600; }
p { margin: 0 0 12px; }
a { color: var(--link); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: 12px 16px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }

/* bare pages (sign-in, errors) */
.bare-head { padding: 32px var(--gap) 0; max-width: 480px; margin: 0 auto; }
.wordmark { font-family: "Archivo Expanded", var(--head); font-weight: 600; font-size: 22px; letter-spacing: .02em; color: var(--ink); white-space: nowrap; margin: 0; }
.wordmark i { display: inline-block; width: .22em; height: .22em; margin-left: .08em; border-radius: 50%; background: var(--accent); }
.bare-head .wordmark { font-size: 28px; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand .clinic { padding-left: 14px; border-left: 1px solid var(--line); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-bar { font-family: var(--body); }
.bare { max-width: 480px; margin: 0 auto; padding: 24px var(--gap) 48px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px var(--gap); margin: 0 0 var(--gap); }
label { display: block; font-weight: 500; margin: 0 0 6px; }
input[type=email], input[type=text] { width: 100%; min-height: 48px; font: inherit; padding: 10px 12px; border: 1px solid #8B9097; border-radius: 8px; background: var(--surface); color: var(--ink); margin: 0 0 12px; }
input[readonly] { background: var(--bg); }
label.check { display: flex; gap: 10px; align-items: center; font-weight: 400; min-height: 44px; margin: 0 0 12px; }
label.check input { width: 22px; height: 22px; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 20px; font: 500 16px var(--body); border-radius: 8px; border: 1px solid var(--accent); cursor: pointer; text-decoration: none; }
.primary, .button { background: var(--accent); color: var(--accent-ink); width: 100%; }
.secondary { background: var(--surface); color: var(--link); border-color: var(--line); width: 100%; }
.link { background: none; border: 0; color: var(--link); text-decoration: underline; padding: 0 4px; min-height: 44px; }
form.plain { display: inline; margin: 0; }
.notice { background: var(--surface); border-left: 4px solid var(--accent); padding: 12px var(--gap); border-radius: 4px; }
.sub { color: var(--muted); margin-top: -6px; }

/* signed-in frame */
.preview-bar { margin: 0; padding: 10px var(--gap); background: var(--ink); color: #fff; font-size: 14px; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); padding: 8px var(--gap); max-width: 1200px; margin: 0 auto; min-height: 56px; }
.clinic { font-family: var(--head); font-weight: 600; font-size: 17px; color: var(--ink); text-decoration: none; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 500; }
.menu summary::-webkit-details-marker { display: none; }
.menu nav { position: fixed; inset: 56px 0 0 0; background: var(--surface); overflow: auto; padding: var(--gap); }
.menu ul, .side ul { list-style: none; margin: 0; padding: 0; }
.menu li a, .menu li button, .side li a, .side li button { display: flex; align-items: center; min-height: 48px; padding: 0 12px; font-size: 17px; }
.menu li a, .side li a, .menu li button.link, .side li button.link { color: var(--ink); text-decoration: none; border-radius: 8px; border-left: 4px solid transparent; width: 100%; text-align: left; justify-content: flex-start; font-weight: 500; }
.menu li a:hover, .side li a:hover, .menu li button.link:hover, .side li button.link:hover { background: var(--bg); }
.menu li a[aria-current=page], .side li a[aria-current=page] { background: var(--bg); border-left-color: var(--accent); font-weight: 600; }
[aria-current=page] { font-weight: 600; color: var(--ink); }
.shell { max-width: 1200px; margin: 0 auto; }
.side { display: none; }
.page { padding: 24px var(--gap) 48px; }

.rows { list-style: none; margin: 0 0 var(--gap); padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rows li + li { border-top: 1px solid var(--line); }
.row { display: flex; flex-direction: column; padding: 12px var(--gap); min-height: 56px; color: var(--ink); text-decoration: none; }
.row-main { font-weight: 500; }
.row-sub { color: var(--muted); font-size: 15px; }
.facts { display: grid; grid-template-columns: 1fr; gap: 2px var(--gap); margin: 0 0 24px; }
.facts dt { color: var(--muted); font-size: 15px; margin-top: 10px; }
.facts dd { margin: 0; font-weight: 500; }
.actions { display: grid; gap: var(--gap); max-width: 360px; }

@media (min-width: 768px) {
  body { font-size: 15px; }
  h1 { font-size: 30px; }
  .facts { grid-template-columns: 220px 1fr; }
  .facts dt { margin-top: 0; }
}
@media (min-width: 900px) {
  :root { --gap: 24px; }
  .menu { display: none; }
  .shell { display: grid; grid-template-columns: 240px 1fr; }
  .side { display: block; padding: 24px var(--gap); }
  .side li a, .side li button { font-size: 15px; }
}

/* ---- stage 3: pages of one clinic. Even grids, no pills, no empty boxes. Phone first. */
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.page-head { margin: 0 0 20px; }
.page-head h1 { margin-bottom: 4px; }
.page-head .sub { margin: 0; }
.block { margin: 0 0 28px; }
.block > h2 { margin-bottom: 10px; }
h3 { font-size: 16px; font-weight: 600; margin: 20px 0 8px; }
.head-links { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 20px; }
.head-links a { min-height: 44px; display: inline-flex; align-items: center; }
.card-line { margin: 0 0 var(--gap); color: var(--ink); }
.foot { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.foot.late { color: var(--muted); font-style: normal; border-left: 3px solid var(--line); padding-left: 10px; }
.headline { font-family: var(--head); font-size: 24px; font-weight: 500; margin: 0 0 4px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap); margin: 0 0 var(--gap); }
.tiles.n1 > .tile, .tiles.n3 > .tile:last-child { grid-column: 1 / -1; }
.tiles.one { grid-template-columns: minmax(0, 1fr); max-width: 360px; }
.tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile p { margin: 0; }
.tile-label { color: var(--muted); font-size: 14px; }
.tile-value { font-family: var(--head); font-size: 32px; font-weight: 500; line-height: 1.15; overflow-wrap: anywhere; }
.tile-period { color: var(--muted); font-size: 14px; margin: 0 0 4px; }
.tile .tile-period { margin: 0; }
.tile-note { font-size: 14px; }

.rows .wait { display: flex; flex-direction: column; gap: 4px; padding: 12px var(--gap); }
.wait-link { min-height: 44px; display: inline-flex; align-items: center; font-weight: 500; }
.row { min-height: 56px; justify-content: center; }
a.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: center; }
a.row > .row-main, a.row > .row-sub { grid-column: 1; }
a.row::after { content: ""; grid-column: 2; grid-row: 1 / span 2; width: 9px; height: 9px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); margin-right: 4px; }
a.row:hover { background: var(--bg); }
a.row:hover::after { border-color: var(--ink); }
a.row:focus-visible { outline-offset: -3px; }
.rows .review { display: flex; flex-direction: column; padding: 12px var(--gap); gap: 2px; }
.review-text { overflow-wrap: anywhere; }

.steps { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.steps li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.steps li { padding: 10px 6px; text-align: center; border-bottom: 3px solid var(--line); color: var(--muted); }
.steps li.here { font-weight: 600; color: var(--ink); border-bottom-color: var(--accent); }

.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); margin: 0 0 28px; }
.review-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--gap); min-width: 0; display: flex; flex-direction: column; }
.review-card h2 { margin: 12px 0 0; }
.review-card p { margin: 0 0 8px; }
.review-card .round { font-weight: 500; }
.shot { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; background: var(--bg); border: 1px solid var(--line); }
.shot.placeholder { display: flex; align-items: center; justify-content: center; font-family: var(--head); font-size: 56px; color: var(--muted); }
progress { width: 100%; height: 10px; margin: 0 0 6px; accent-color: var(--accent); }
button[disabled] { opacity: .55; cursor: not-allowed; }
.review-card .button, .review-card .primary { margin: 4px 0 12px; }

table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 var(--gap); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
thead th { color: var(--muted); font-weight: 500; font-size: 14px; }
td.overdue { color: #A3200F; font-weight: 600; }
details.fold > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 500; color: var(--link); }

/* tables become two-line cards on a phone (design rule 3) */
@media (max-width: 767px) {
  table.stack, table.stack tbody, table.stack tr, table.stack th, table.stack td { display: block; }
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stack { border: 0; background: none; }
  table.stack tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 12px; padding: 4px 0; }
  table.stack th[scope=row] { font-family: var(--head); font-weight: 500; font-size: 17px; border: 0; padding: 10px 14px 2px; }
  table.stack td { border: 0; padding: 4px 14px; display: flex; justify-content: space-between; gap: 12px; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--muted); flex: 0 0 auto; }
  table.stack td:last-child:not([data-label]) { padding-bottom: 10px; }
}
@media (min-width: 768px) {
  .steps { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
  .steps li:last-child:nth-child(odd) { grid-column: auto; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .tiles.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles.n3 > .tile:last-child, .tiles.n1 > .tile { grid-column: auto; }
  .tiles.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
  .tiles.n1 { grid-template-columns: minmax(0, 1fr); max-width: 280px; }
  .tiles.two { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 640px; }
  .tiles.one { max-width: 280px; }
  .tile-value { font-size: 32px; }
}
@media (min-width: 900px) {
  /* a website review card is full width: preview on the left, the details on the right */
  .review-card { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 24px; align-content: start; align-items: start; }
  .review-card > .shot { grid-column: 1; grid-row: 1 / span 20; align-self: start; }
  .review-card > :not(.shot) { grid-column: 2; }
  .review-card h2 { margin-top: 0; }
  .review-card form.plain, .review-card .button { max-width: 280px; }
  .page { padding: 32px var(--gap) 64px; }
}
.small a, .small button { font-size: 15px; }
.side li button.link, .menu li button.link { background: none; border-top: 0; border-right: 0; border-bottom: 0; }
.menu li.small a, .side li.small a, .menu li.small button, .side li.small button { color: var(--muted); }
.menu li.small a[aria-current=page], .side li.small a[aria-current=page] { color: var(--ink); }
.small { margin-top: 0; }
.menu li.small:first-of-type, .side li.small:first-of-type { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.preview-bar { position: sticky; top: 0; z-index: 6; }
.primary:disabled { background: var(--muted); border-color: var(--muted); }

/* touch targets: every link a person taps is at least 44px tall */
.clinic { display: inline-flex; align-items: center; min-height: 44px; }
.tap, td a, .back a { display: inline-flex; align-items: center; min-height: 44px; }
details.fold.open-wide > summary { display: none; }
