:root {
  --tdc-aqua: #28cff9;
  --tdc-blue: #689ade;
  --tdc-navy: #002e5d;
  --tdc-ink: #172230;
  --tdc-muted: #667487;
  --tdc-line: #dfe7ed;
  --tdc-wash: #f5f9fb;
  --tdc-white: #fff;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  color: var(--tdc-ink);
  background: #f5f8fa;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }
.dev-banner {
  position: relative; z-index: 2; display: flex; justify-content: center; align-items: center;
  gap: 9px; min-height: 34px; padding: 6px 14px; background: #fff7e4; color: #67501e;
  border-bottom: 1px solid #f0dfb5; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-align: center;
}
.dev-dot { width: 8px; height: 8px; border-radius: 50%; background: #dd9d18; box-shadow: 0 0 0 3px #f7e9c8; }
.login-shell { min-height: calc(100vh - 34px); display: grid; grid-template-columns: minmax(360px, 1fr) minmax(440px, 1fr); background: white; }
.login-aside { position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 38px clamp(36px, 7vw, 100px); color: white; background: radial-gradient(circle at 80% 20%, rgba(40,207,249,.29), transparent 34%), linear-gradient(148deg, #002e5d 0%, #064574 58%, #0b6386 100%); overflow: hidden; }
.login-aside::after { content: ""; position: absolute; width: 480px; height: 480px; right: -200px; bottom: -230px; border: 1px solid rgba(255,255,255,.18); border-radius: 50%; box-shadow: 0 0 0 48px rgba(255,255,255,.04), 0 0 0 98px rgba(255,255,255,.03); }
.logo { display: block; width: 238px; max-width: 100%; height: auto; object-fit: contain; }
.aside-copy { position: relative; z-index: 1; max-width: 460px; margin: auto 0; padding: 80px 0; }
.eyebrow { color: #168db4; font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.login-aside .eyebrow { color: #92eaff; }
.aside-copy h1 { margin: 22px 0 14px; font-size: clamp(42px, 5.4vw, 68px); line-height: 1.03; letter-spacing: -.045em; }
.aside-copy h1 em { color: #74ddf7; font-family: Georgia, serif; font-weight: 400; }
.aside-copy p { max-width: 370px; color: #d8e9f4; line-height: 1.75; font-size: 17px; }
.aside-foot { position: relative; z-index: 1; color: #c0d7e6; font-size: 12px; }
.login-main { display: grid; place-items: center; padding: 44px 28px; }
.login-card { width: min(100%, 420px); }
.login-brand--mobile { display: none; }
.login-card h2 { margin: 11px 0 8px; font-size: 32px; letter-spacing: -.04em; color: var(--tdc-navy); }
.muted { color: var(--tdc-muted); line-height: 1.6; }
form label { display: block; margin: 20px 0 7px; font-size: 14px; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid #cfdbe4; border-radius: 8px; background: #fff; color: var(--tdc-ink); outline: none; }
textarea { min-height: 100px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: #36b8da; box-shadow: 0 0 0 3px rgba(40,207,249,.17); }
.button { min-height: 42px; border: 0; border-radius: 999px; padding: 10px 18px; display: inline-flex; gap: 9px; align-items: center; justify-content: center; cursor: pointer; font-weight: 750; transition: transform .12s ease, filter .12s ease; }
.button:hover { filter: brightness(.97); transform: translateY(-1px); }
.button.primary { background: var(--tdc-aqua); color: var(--tdc-navy); }
.button.outline { border: 1px solid #cbd9e2; background: #fff; color: var(--tdc-navy); }
.button.quiet { background: #eef7fa; color: var(--tdc-navy); }
.button.small { min-height: 38px; padding: 7px 14px; font-size: 14px; line-height: 1.25; }
.button.full { width: 100%; margin-top: 22px; min-height: 48px; }
.error-message { min-height: 18px; margin: 9px 0 0; color: #ac2e2e; font-size: 12px; }
.dev-note { margin-top: 28px; padding: 14px 16px; border: 1px solid #d8eaf0; border-radius: 10px; background: #f3fbfd; color: #50677a; font-size: 12px; line-height: 1.55; }
.dev-note strong { color: var(--tdc-navy); }
.portal-shell { min-height: calc(100vh - 34px); background: #f5f8fa; }
.topbar { height: 74px; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 0 clamp(18px, 4vw, 56px); background: white; border-bottom: 1px solid #e7edf1; }
.brand img { display: block; width: 180px; max-height: 50px; object-fit: contain; object-position: left center; }
.topbar-right { display: flex; align-items: center; gap: 15px; }
.workspace-switch { text-decoration: none; white-space: nowrap; }
.account-label { color: #536374; font-size: 13px; font-weight: 650; }
.portal-content { max-width: 1440px; margin: 0 auto; padding: 32px clamp(16px, 3.4vw, 50px) 56px; }
.portal-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 24px; }
.portal-title-row h1 { margin: 7px 0 3px; color: var(--tdc-navy); font-size: clamp(28px, 4vw, 42px); letter-spacing: -.04em; }
.portal-title-row p { margin: 0; }
.flash { margin-bottom: 18px; padding: 12px 15px; border: 1px solid #b8e3ce; border-radius: 8px; background: #effaf4; color: #266343; font-size: 13px; }
.flash.error { border-color: #efc9c9; background: #fff3f3; color: #8e2929; }
.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0,1fr)); }
.mb18 { margin-bottom: 18px; }
.mt18 { margin-top: 18px; }
.mt20 { margin-top: 20px; }
.stat-compact { font-size: 21px; }
.stat-medium { font-size: 25px; }
.stack { display: grid; gap: 18px; }
.card { min-width: 0; padding: 22px; border: 1px solid #e2e9ee; border-radius: 14px; background: #fff; box-shadow: 0 8px 25px rgba(24,53,78,.035); }
.card h2, .card h3 { color: var(--tdc-navy); }
.card h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.28; }
.card h3 { margin: 0; font-size: 19px; line-height: 1.3; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 17px; }
.patient-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.patient-overview > .patient-home-primary, .patient-overview > .patient-information { grid-column: 1 / -1; }
.patient-overview h2 { margin-bottom: 12px; }
.patient-overview .row-title { font-size: 16px; overflow-wrap: anywhere; }
.patient-overview .row-detail { font-size: 14px; overflow-wrap: anywhere; }
.patient-home-primary { border-top: 4px solid #08718f; background: #f4fbfe; }
.patient-estimate { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.patient-estimate dl { margin: 0; }
.patient-estimate dt { color: #405a70; font-size: 14px; font-weight: 750; }
.patient-estimate dd { margin: 2px 0 0; color: var(--tdc-navy); font-size: clamp(25px, 4.5vw, 34px); font-weight: 800; font-variant-numeric: tabular-nums; }
.patient-estimate .button { text-decoration: none; }
.patient-appointment time, .patient-balance-amount { display: block; color: var(--tdc-navy); font-size: clamp(24px, 4.2vw, 33px); font-weight: 750; line-height: 1.24; }
.patient-appointment p, .patient-balance-amount { margin: 6px 0 12px; }
.patient-appointment p:last-child { margin-bottom: 0; }
.patient-balance-amount { font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.patient-pay-balance { margin-top: 12px; }
.patient-pay-balance > summary { cursor: pointer; }
.patient-payment-status { margin-top: 9px; }
.patient-payment-history { margin-top: 14px; }
.patient-payment-history summary { padding: 7px 0; color: #08718f; font-weight: 750; cursor: pointer; }
.patient-information-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.patient-information > summary { cursor: pointer; color: #075b78; }
.patient-information > summary h2 { display: inline; margin: 0; }
.patient-information[open] > summary { margin-bottom: 13px; }
.patient-information-grid h3 { margin: 12px 0 8px; }
.patient-contact-list { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 0 0 20px; }
.patient-contact-list dt { font-weight: 700; }
.patient-contact-list dd { margin: 3px 0 0; overflow-wrap: anywhere; }
@media (max-width: 690px) {
  .patient-overview, .patient-information-grid { grid-template-columns: minmax(0, 1fr); }
  .patient-overview .card { padding: 17px; }
}
.card-subtitle { margin: 0; color: var(--tdc-muted); font-size: 14px; }
.stat-label { color: #69798b; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
.stat-value { margin: 8px 0 4px; color: var(--tdc-navy); font-size: 32px; font-weight: 750; letter-spacing: -.035em; }
.stat-foot { color: var(--tdc-muted); font-size: 12px; }
.patient-head { display: flex; align-items: center; gap: 17px; }
.patient-avatar { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 50%; background: #def8ff; color: #00658b; font-weight: 800; }
.patient-name { margin: 0; color: var(--tdc-navy); font-size: 21px; }
.patient-meta { margin-top: 4px; color: var(--tdc-muted); font-size: 14px; }
.badge { display: inline-flex; align-items: center; padding: 5px 9px; border-radius: 999px; background: #e8faff; color: #00658b; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.badge.warn { background: #fff5da; color: #775411; }
.badge.neutral { background: #eef1f4; color: #586777; }
.row-list { display: grid; }
.row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 13px 0; border-top: 1px solid #edf1f4; }
.row:first-child { border-top: 0; padding-top: 0; }
.row:last-child { padding-bottom: 0; }
.row-main { min-width: 0; }
.row-title { color: #24374a; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
.row-detail { margin-top: 4px; color: var(--tdc-muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.notice { margin-top: 15px; padding: 12px 14px; border-radius: 9px; background: #f2f9fc; color: #496376; font-size: 13px; line-height: 1.55; }
.fee-schedule-text { margin: 14px 0 0; padding: 16px; max-height: min(70vh, 900px); overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid #e2e9ee; border-radius: 10px; background: #f8fbfc; color: var(--tdc-navy); font: 12px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.empty { padding: 22px 10px; color: var(--tdc-muted); text-align: center; font-size: 14px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { padding: 10px; color: #516479; text-align: left; font-size: 12px; letter-spacing: .025em; }
td { padding: 12px 10px; border-top: 1px solid #edf1f4; vertical-align: top; }
.text-button { border: 0; padding: 0; background: none; color: #08779b; cursor: pointer; font-weight: 750; }
.file-download-link { display: inline-block; margin-top: 7px; color: #08779b; font-size: 14px; font-weight: 750; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-grid label { margin-top: 7px; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 15px; }
.portal-footer { padding: 18px; border-top: 1px solid #e4ebef; color: #798899; text-align: center; font-size: 11px; }
.amount { color: var(--tdc-navy); font-weight: 750; white-space: nowrap; }
.pill-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.search-empty { padding: 16px; color: var(--tdc-muted); }
.checkbox-label { display: flex; align-items: center; gap: 9px; }
.checkbox-label input { width: 16px; min-height: 16px; margin: 0; }
.care-intake-photo { object-fit: cover; flex-shrink: 0; }
.care-record > summary, .care-disclosure > summary { cursor: pointer; color: var(--tdc-navy); font-weight: 750; }
.care-section-body { margin-top: 12px; }
.care-section-body > label { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.care-section-body select { width: min(100%, 250px); }
.care-queue-rows { margin-top: 14px; }
.care-record { margin-top: 10px; border: 1px solid #dbe7ee; border-radius: 9px; }
.care-record > summary { padding: 10px 12px; overflow-wrap: anywhere; }
.care-record[open] > summary { background: #f2f7f9; border-radius: 8px 8px 0 0; }
.care-record-body { padding: 12px; }
.care-tag { margin-inline-start: 8px; padding: 3px 7px; border-radius: 5px; background: #e8f2f7; color: #37536a; font-size: 11px; white-space: nowrap; }
.care-facts { display: flex; flex-wrap: wrap; gap: 12px 22px; margin: 3px 0 10px; }
.care-facts dt { font-size: 12px; font-weight: 750; color: #536374; }
.care-facts dd { margin: 3px 0 0; overflow-wrap: anywhere; }
.care-summary-text { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
.care-disclosure { margin-top: 10px; font-size: 13px; }
.care-disclosure form { margin-top: 6px; }
.care-allowance { margin-top: 14px; padding-top: 10px; border-top: 1px solid #e2e9ee; }
.care-visit { padding: 9px 0; border-bottom: 1px solid #e2e9ee; }
.care-visit:last-child { border-bottom: 0; }
.care-quote-line { display: grid; grid-template-columns: minmax(0, 1fr) minmax(100px, .5fr); gap: 7px 10px; margin: 10px 0; }
.care-quote-line label { margin-top: 0; }
.care-quote-line button { grid-column: 1 / -1; justify-self: start; }
.care-quote-fee { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 6px 10px; }
.care-quote-fee:not(:has([data-line-arch-field]:not([hidden]))) { grid-template-columns: minmax(0, 1fr); }
.care-quote-fee > p { grid-column: 1 / -1; }
.care-fee-status { margin-top: 8px; }
.care-inline { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.schedule-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; margin-bottom: 8px; }
.schedule-toolbar label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.schedule-toolbar input { min-height: 36px; padding-block: 6px; }
.care-quote-items { list-style: none; margin: 8px 0; padding: 0; }
.care-quote-items li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #e2e9ee; padding: 7px 0; }
.care-quote-items li span { overflow-wrap: anywhere; }
.care-quote-items li strong { white-space: nowrap; }

@media (max-width: 460px) {
  .care-quote-line { grid-template-columns: minmax(0, 1fr); }
}
.review-form { display: grid; grid-template-columns: minmax(130px,.7fr) minmax(160px,1fr) auto; gap: 7px; align-items: center; margin-top: 11px; }
.review-form select, .review-form input { min-height: 34px; padding: 6px 9px; font-size: 11px; }
.review-history { margin-top: 8px; color: var(--tdc-muted); font-size: 11px; }
.review-history summary { cursor: pointer; color: #08779b; font-weight: 700; }
.intake-answers { margin: 7px 0; overflow-wrap: anywhere; }
.intake-answers summary { width: fit-content; padding: 5px 0; color: #08718f; cursor: pointer; font-weight: 700; }
.intake-answers h4 { margin: 16px 0 7px; }
.intake-answers dl, .intake-answers p { margin: 0 0 10px; }
.intake-answers dl { display: grid; gap: 8px; }
.intake-answers dt { font-weight: 650; }
.intake-answers dd { margin: 1px 0 0; }
.intake-answers dd, .intake-text { white-space: pre-wrap; }
.chart-intake-sharing h4 { margin: 0 0 8px; color: var(--tdc-navy); }
.row-list + .chart-intake-sharing { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--tdc-line); }
.note-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 9px 15px; margin-top: 9px; }
.note-actions summary { cursor: pointer; color: #08779b; font-weight: 750; }
.note-actions details[open] { flex: 1 0 100%; }
.note-actions form { margin-top: 9px; }
.note-actions textarea { min-height: 80px; margin-bottom: 8px; }
.review-event { margin-top: 7px; padding: 8px 10px; border-left: 2px solid #cdeaf3; background: #f8fbfd; line-height: 1.5; }
.intake-invite-form { margin-top: 8px; }
.intake-invite-result { margin-top: 12px; padding: 12px; border: 1px solid var(--tdc-line); border-radius: 9px; background: var(--tdc-wash); }
.intake-invite-result label { display: block; margin: 0 0 7px; color: var(--tdc-muted); font-size: 11px; }
.copy-link-row { display: flex; align-items: center; gap: 8px; }
.copy-link-row input { min-width: 0; min-height: 36px; font-size: 11px; }
.square-payment-form { display: grid; gap: 11px; margin-top: 16px; padding-top: 15px; border-top: 1px solid #edf1f4; }
.square-card-container { min-height: 48px; padding: 11px 12px; border: 1px solid #cfd9e0; border-radius: 8px; background: #fff; }
.square-payment-message { min-height: 18px; margin: 0; color: var(--tdc-muted); font-size: 12px; }
@media (max-width: 860px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-aside { display: none; }
  .login-main { padding: 34px 22px; }
  .login-brand--mobile { display: block; }
  .grid.three { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
@media (max-width: 620px) {
  .grid.two, .grid.three, .form-grid { grid-template-columns: 1fr; }
  .form-grid .wide { grid-column: auto; }
  .topbar { height: 64px; padding: 0 14px; }
  .brand img { width: 150px; }
  .account-label { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .portal-content { padding-top: 25px; }
  .portal-title-row { align-items: flex-start; }
  .review-form { grid-template-columns: 1fr; }
  .copy-link-row { align-items: stretch; flex-direction: column; }
  .card { padding: 17px; }
}

.office-portal { background: #eff4f8; }
.office-portal .topbar { height: 62px; }
.office-portal > .portal-content { max-width: 1480px; padding: 21px clamp(16px, 3vw, 44px) 56px; }
.office-portal :focus-visible { outline: 2px solid #08718f; outline-offset: 3px; }
.office-portal.compact-office-masthead .flash { margin-bottom: 9px; padding: 7px 11px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.office-portal .button:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.office-portal #portal-content .button { border-radius: 8px; text-decoration: none; }
.office-portal #portal-content .button.small { min-height: 40px; }
.office-portal #portal-content .button.primary { background: var(--tdc-navy); color: #fff; }
.office-workspace-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 9px 16px; margin-bottom: 13px; }
.office-workspace-actions { display: flex; align-items: center; gap: 6px; }
.office-tabs { display: flex; flex-wrap: wrap; gap: 4px; max-width: 100%; }
.office-tabs button {
  border: 0; cursor: pointer;
  padding: 9px clamp(10px, 1.5vw, 18px); font-size: 15px; font-weight: 750; white-space: nowrap;
}
.office-tabs-office { padding: 4px; border: 1px solid #d5e1ea; border-radius: 11px; background: #e3ebf2; }
.office-tabs-office button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 7px; }
.office-tabs-practice { margin-bottom: 12px; }
.office-tabs-practice button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 7px; }
.office-tab-count { display: inline-grid; place-items: center; min-width: 22px; min-height: 21px; padding-inline: 4px; border: 1px solid #e0ae60; border-radius: 8px; background: #fff1d5; color: #643900; font-size: 12px; font-variant-numeric: tabular-nums; }
.office-tab-count[hidden] { display: none; }
.office-tabs-chart { flex-wrap: wrap; gap: 3px; margin-top: 12px; }
.office-tabs-chart button { padding-block: 10px 8px; border-radius: 7px; }
.chart-tab-divider {
  flex: 0 0 1px; align-self: stretch; margin: 6px 6px; border-radius: 1px;
  background: var(--ui-control, #bdcdd8);
}
.office-patients-grid { display: grid; grid-template-columns: minmax(314px, .72fr) minmax(0, 1.28fr); gap: 16px; align-items: start; }
.office-patients-grid.has-open-chart { grid-template-columns: minmax(0, 1fr); }
.office-directory[hidden], [data-request-booking][hidden] { display: none; }
.office-chart-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.office-management h2 { margin: 0 0 10px; }
.schedule-controls [data-calendar-navigation][hidden] { display: none; }
.front-desk-visit .management-actions { margin-top: 4px; }
.front-desk-visit .care-tag { margin-inline-start: 0; }
.portal-shell .schedule-contact-status[data-contact-done="true"] { color: #215442; background: #e3f2e9; }
.portal-shell .schedule-contact-status[data-contact-done="false"] { color: #603e12; background: #fff0da; }
.patient-next-installment h3, .patient-next-installment p { margin: 0; }
.patient-next-installment { margin-block: 12px; }
.front-desk-groups { display: grid; gap: 12px; margin-block: 14px; }
.front-desk-group { padding: 11px 13px; border: 1px solid var(--ui-line, #c7dbe7); border-radius: 10px; }
.front-desk-group h4 { margin: 0 0 7px; color: var(--tdc-navy); }
.front-desk-group h4 span { margin-inline-start: 5px; font-size: .85em; font-variant-numeric: tabular-nums; }
.front-desk-group > .card-subtitle { margin: 0; }
.front-desk-group[aria-label="Arrived"] { border-inline-start: 4px solid #4c9a85; }
.front-desk-group[aria-label="Upcoming"] { border-inline-start: 4px solid #6189b0; }
.front-desk-group[aria-label="Finished"] { border-inline-start: 4px solid #929bad; }
.staff-setup-card { width: min(540px, calc(100% - 32px)); margin: 6vh auto 0; padding: 24px; }
.staff-setup-card [hidden] { display: none; }
.login-new-password-fields { min-width: 0; margin: 0 0 16px; padding: 10px 12px 0; border: 1px solid var(--ui-control, #a7bdc3); border-radius: 8px; }
.login-new-password-fields legend { padding-inline: 5px; font-weight: 700; }
#patient-recovery [hidden] { display: none; }
#patient-recovery [data-recovery-account] { overflow-wrap: anywhere; }
#patient-recovery .checkbox-label { margin-block: 10px; }
.office-management h3 { margin-block: 16px 8px; }
.office-management .office-search { max-width: 580px; margin: 12px 0; }
.office-management [hidden] { display: none; }
.management-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.office-management-period { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.audit-filter-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr)); gap: 8px 12px; }
.audit-filter-fields > div { min-width: 0; }
.audit-filter-fields label { margin-top: 4px; }
.audit-filter-fields :is(input, select) { width: 100%; }
#audit-filters { margin-block: 12px 16px; }
.office-finance-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 185px), 1fr)); gap: 10px; margin: 8px 0 16px; }
.office-finance-totals > div { padding: 12px; border: 1px solid #d8e4ea; border-radius: 9px; background: #f4f8f9; }
.office-finance-totals dt { color: #38556a; font-size: .9rem; }
.office-finance-totals dd { margin: 4px 0 0; font-size: 1.22rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.office-plan-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.office-payment-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 14px; margin-block: 14px; }
.collection-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; margin: 8px 0; }
.collection-totals > div { padding: 10px 13px; border: 1px solid #d5e4e8; border-radius: 9px; background: #f4f8f9; }
.collection-totals > [data-total="due"] { border-color: #e3cda7; background: #fbf2e1; }
.collection-totals > [data-total="collected"] { border-color: #b9d6cb; background: #e9f3ed; }
.collection-totals > [data-total="balance"] { border-color: #b2cfd1; background: #e7f2f2; }
.collection-totals dt { color: var(--ui-ink); font-size: 14px; font-weight: 650; }
.collection-totals dd { margin: 2px 0 0; font-size: 1.3rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.collection-totals small { color: var(--ui-muted); }
.payment-state { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 750; }
.payment-state[data-tone="success"] { background: #e1f0e7; color: #215442; }
.payment-state[data-tone="warning"] { background: #fff0d7; color: #683e0a; }
.payment-state[data-tone="danger"] { background: #fbe5df; color: #8a3327; }
.payment-state[data-tone="info"] { background: #e1edf7; color: #264d6e; }
.payment-state[data-tone="neutral"] { background: #ecf0f2; color: #425567; }
.collection-receipt, .ledger-receipt, .terminal-device-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px;
}
.collection-receipt { padding-block: 5px 8px; }
.ledger-receipt { margin-top: 5px; }
.receipt-activity { list-style: none; display: grid; gap: 4px; margin: 0; padding: 0; }
.receipt-activity li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 3px 6px; color: var(--ui-muted); font-size: 12px; }
.terminal-device-line { margin-block: 9px; font-size: 14px; font-weight: 650; }
.terminal-device-line [data-device-detail] { flex-basis: 100%; margin: 0; font-weight: 400; }
.terminal-device-line [data-check-device] { min-height: 34px; }
.terminal-payment-review, .installment-detail { line-height: 1.6; }
.office-payment-options form > label { display: block; margin-top: 9px; }
.collection-change { margin: 8px 0; padding: 7px 9px; border-radius: 8px; background: #e8f3ed; color: #215442; }
.office-payment-options .square-link-existing { margin-top: 16px; padding-block: 10px; border-top: 1px solid var(--tdc-line); }
.office-payment-options .square-link-existing summary { cursor: pointer; font-weight: 700; }
.office-payment-options [hidden] { display: none; }
.patient-appointment-request { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--tdc-line); }
.patient-appointment-request summary { cursor: pointer; color: var(--tdc-navy); font-weight: 700; }
.patient-appointment-request summary.button { display: inline-flex; }
.patient-appointment-request summary.primary { color: #fff; }
.patient-appointment-request form { margin-top: 10px; }
.office-directory { position: sticky; top: 12px; padding: 19px; }
.office-directory .card-head { margin-bottom: 12px; }
.office-search label { margin: 0 0 5px; color: #40566a; }
.office-search > div { display: flex; gap: 7px; }
.office-search input { min-width: 0; min-height: 38px; padding: 7px 9px; font-size: 14px; }
.office-directory-results { max-height: min(46vh, 500px); padding: 4px 4px 4px 2px; margin-top: 9px; overflow-y: auto; scrollbar-gutter: stable; }
.office-directory-results .empty { margin: 0; padding: 12px 4px; text-align: left; }
.office-directory-list { display: grid; gap: 7px; }
.office-directory-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px; border: 1px solid #dce6ef; border-radius: 9px; }
.office-directory-row:hover { border-color: #a8c1d1; }
.office-directory-row .row-title { color: var(--tdc-navy); font-size: 17px; }
.office-directory-row .row-detail { margin-top: 2px; font-size: 14px; }
.office-directory-row .button { flex-shrink: 0; white-space: nowrap; }
.office-directory-row.is-selected { border-color: #67a5bc; background: #f3faff; box-shadow: inset 3px 0 #08718f; }
.office-directory-row.is-selected .button { border-color: #0a5475; background: #0a5475; color: #fff; }
.active-patient-directory { margin-top: 12px; padding-block: 10px; border-block: 1px solid var(--tdc-line); }
.active-patient-directory summary { min-height: 36px; padding-block: 7px; color: var(--tdc-navy); cursor: pointer; font-weight: 750; }
.active-patient-directory label { display: block; margin-block: 4px 5px; font-weight: 650; }
.active-patient-directory select { width: 100%; }
.active-patient-directory [role="status"] { margin-block: 8px 0; }
.active-patient-directory .form-actions { justify-content: space-between; }
.office-intake-tools { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--tdc-line); }
.office-intake-tools h3 { margin: 0 0 8px; }
.office-intake-links { display: flex; flex-wrap: wrap; gap: 7px; }
.office-intake-links a { text-decoration: none; }
.office-directory .intake-invite-form { margin-top: 8px; }
.office-directory .intake-invite-form p { margin-top: 5px; }
.office-chart { display: grid; gap: 12px; min-width: 0; }
.office-chart > .office-pane > .card { margin: 0; padding: 18px 20px; scroll-margin-top: 210px; }
.office-chart > .office-pane > .card + .card { margin-top: 12px; }
.office-portal .office-chart-header { padding: 15px 20px 0; border-top: 3px solid #0d7292; }
.office-chart-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; }
.office-chart-top .patient-head { align-items: center; gap: 12px; min-width: 0; }
.office-chart-top .patient-avatar { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 10px; }
.office-chart-top .patient-name { margin: 0; color: var(--tdc-navy); font-size: clamp(23px, 3vw, 31px); line-height: 1.1; letter-spacing: -.03em; overflow-wrap: anywhere; scroll-margin-top: 12px; }
.office-chart-top .patient-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; color: #40576b; font-size: 13px; overflow-wrap: anywhere; }
.office-chart-top #clear-patient { flex-shrink: 0; white-space: nowrap; }
.office-record-number { color: #526b81; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.office-chart-facts { display: flex; flex-wrap: wrap; margin: 8px 0 0; gap: 5px 18px; }
.office-chart-facts > div { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 6px; min-width: 0; }
.office-chart-facts dt { color: #455f75; font-size: 13px; font-weight: 700; }
.office-chart-facts dd { margin: 0; font-size: 14px; }
.office-chart-facts .text-button { min-height: 28px; padding: 1px 0; }
.office-chart-alerts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chart-task { padding: 5px 9px; border: 1px solid #dfb375; border-radius: 7px; background: #fff3db; color: #683e0a; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.chart-task:hover { background: #ffebc2; }
.treatment-plan-heading { gap: 8px; flex-wrap: wrap; }
.treatment-plan-heading .text-button { min-height: 32px; }
.treatment-overview-preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-block: 5px; }
.treatment-plan-edit summary { cursor: pointer; color: #075b78; font-weight: 700; }
.treatment-plan-edit form { margin-top: 9px; }
#chart-intakes-title { scroll-margin-top: 220px; }
.office-chart-empty { padding: 18px 20px; border: 1px dashed #b7cbd9; background: #f8fbfd; box-shadow: none; }
.office-chart-empty p { margin: 5px 0 0; color: #40576b; font-size: 14px; }
.office-chart .card-head { margin-bottom: 12px; }
.office-chart .card-head :is(h2, h3) { font-size: 20px; }
.office-portal .badge { border-radius: 6px; letter-spacing: 0; }
.office-chart .row-detail { font-size: 14px; }
.office-chart .review-form { display: flex; flex-wrap: wrap; gap: 8px; }
.office-chart .review-form input { flex: 1 1 220px; font-size: 1rem; }
.office-chart .review-form .form-actions { margin: 0; justify-content: flex-start; }
.office-chart #staff-note-form { padding: 11px 12px; border-radius: 9px; background: #f0f6fa; }
.office-chart #staff-note-form label { margin-top: 0; }
.office-chart #staff-note-form textarea { min-height: 78px; }
.office-chart #staff-note-form .form-actions { margin-top: 8px; }
.office-note-list { margin-top: 10px; }
.office-note { position: relative; padding: 12px 44px 12px 0; border-bottom: 1px solid var(--tdc-line); }
.office-note .row-detail { white-space: pre-wrap; }
.office-note-actions { display: block; margin: 0; }
.office-note-actions > .office-actions-menu { position: absolute; top: 7px; right: 0; }
.office-note-actions .office-note-edit { margin: 8px -44px 0 0; padding: 6px 12px 12px; border-radius: 8px; background: #f4f8fb; }
.office-note-edit label { margin: 5px 0; }
.office-note-buttons { display: flex; flex-wrap: wrap; gap: 7px; }
.office-ledger-entry { margin-top: 12px; padding: 10px; border: 1px solid var(--tdc-line); border-radius: 8px; }
.office-ledger-entry summary { cursor: pointer; color: var(--tdc-navy); font-weight: 750; font-size: 14px; }
.office-portal .office-queue-view { max-width: 850px; border-top: 3px solid #0d7292; }
.office-queue-view .care-queue-rows .row { align-items: center; }
.office-queue-view .row-title { color: var(--tdc-navy); font-size: 15px; }
.office-queue-view .row-detail { font-size: 13px; }
.office-queue-view .office-overdue { color: #852525; font-weight: 750; }
.office-queue-view .schedule-toolbar { margin-top: 12px; }
.office-portal #clinic-calendar { max-width: none; }
#office-schedule-panel #care-queue { margin-top: 16px; }
#care-queue-title { scroll-margin-top: 12px; }
.office-portal #clinic-calendar .card-head { flex-wrap: wrap; }
.care-queue-shortcut { align-self: flex-start; }
.care-queue-shortcut .care-tag { margin-inline-start: 0; }
.calendar-patient-picker { width: min(540px, calc(100% - 28px)); max-height: calc(100dvh - 28px); overflow: auto; }
.calendar-patient-picker::backdrop { background: #112b4380; }
.calendar-patient-picker .card-head { align-items: start; }
.visit-checkout { width: min(680px, calc(100% - 28px)); }
.visit-checkout > .card-head { flex-wrap: nowrap; }
.visit-checkout [data-checkout-patient] { margin-bottom: 0; }
.checkout-step { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--tdc-line); border-radius: 10px; }
.checkout-step summary { cursor: pointer; font-weight: 700; color: var(--tdc-navy); }
.checkout-step summary > span + span { float: inline-end; margin-inline-start: 8px; color: var(--tdc-navy); font-variant-numeric: tabular-nums; }
.checkout-step[open] summary > [data-checkout-balance] { display: none; }
.checkout-step > .card-subtitle { margin: 8px 0 0; }
.checkout-step fieldset { min-inline-size: 0; margin: 10px 0 0; padding: 0; border: 0; }
.checkout-step .office-payment-options { margin: 10px 0 0; gap: 8px; }
.checkout-step .office-payment-options .card { padding: 10px; }
.checkout-step .office-payment-options h4 { margin: 0 0 6px; }
.checkout-attendance { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.checkout-attendance h3, .checkout-attendance p { margin: 0; }
.checkout-attendance [hidden], .checkout-message:empty, .checkout-step [data-checkout-receipt]:empty { display: none; }
.checkout-message { margin: 8px 0 0; }
.checkout-message.checkout-error { color: #852525; }
.calendar-current-patient { margin-bottom: 12px; }
.calendar-booking-time { margin-bottom: 14px; }
.calendar-booking-time .card-subtitle { margin-top: 4px; }
#calendar-patient-results { margin-top: 12px; }
#calendar-patient-results .office-directory-row { padding: 9px 0; }
.calendar-initial-booking { border-top: 1px solid var(--tdc-line); margin-top: 14px; padding-top: 12px; }
.calendar-initial-booking summary { cursor: pointer; font-weight: 700; color: var(--tdc-ink); }
.calendar-initial-booking form > .card-subtitle { margin: 8px 0 12px; }
#calendar-initial-status:empty { margin: 0; min-height: 0; }
.chart-next-action { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin: 10px 0; padding: 10px 12px; border: 1px solid #b8dbe7; border-left: 4px solid #08718f; border-radius: 8px; background: #edf7fb; }
.chart-next-action > div > span { color: #21576a; font-size: 13px; font-weight: 750; }
.chart-next-action p { margin: 2px 0 0; }
.chart-next-buttons, .schedule-visit-actions, .schedule-visit-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.schedule-visit-overview { display: grid; gap: 5px; margin-bottom: 12px; }
.schedule-visit-overview > strong { font-size: 1.15rem; }
.schedule-visit-badges .care-tag, .schedule-intake-state { margin: 0; justify-self: start; }
.portal-shell .schedule-intake-state[data-intake-status="not_started"] { background: #fff0d7; color: #683e0a; }
.portal-shell .schedule-intake-state[data-intake-status="link_ready"] { background: #e1edfd; color: #26496c; }
.portal-shell .schedule-intake-state[data-intake-status="sent"] { background: #eee6fa; color: #51387b; }
.portal-shell .schedule-intake-state[data-intake-status="expired"] { background: #fbe3df; color: #822e22; }
.portal-shell .schedule-intake-state[data-intake-status="submitted"] { background: #d7edf0; color: #175458; }
.portal-shell .schedule-intake-state[data-intake-status="reviewed"], .portal-shell .schedule-visit-badges [data-visit-state="arrived"] { background: #dff1ec; color: #194e41; }
.schedule-booking[data-visit-state="arrived"], .schedule-week-cell[data-visit-state="arrived"] { background: #dff1ec; }
.schedule-booking[data-visit-state="completed"], .schedule-booking[data-visit-state="no_show"], .schedule-week-cell[data-visit-state="completed"], .schedule-week-cell[data-visit-state="no_show"] { background: #f1f1f5; }
.schedule-intake-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.schedule-booking-state { color: #37556c; }
.schedule-intake-filter { width: fit-content; }
.linked-intake-tools { margin: 12px 0; }
.linked-intake-tools input { margin-top: 5px; }
.linked-intake-qr { display: block; max-width: 100%; width: auto; height: auto; margin: 9px auto 0; image-rendering: pixelated; }
.linked-intake-qr[hidden] { display: none; }
[data-intake-draft][hidden], [data-intake-link="sent"][hidden] { display: none; }
[data-intake-recipient] { overflow-wrap: anywhere; }
.schedule-visit-feedback:not(:empty) { margin: 6px 0; }
.schedule-visit-feedback:empty { margin: 0; min-height: 0; }
.schedule-requests { margin-top: 16px; }
.treatment-appliance-next { display: block; padding: 3px 0 0 18px; color: var(--tdc-muted); font-size: 13px; font-weight: 600; }
.treatment-appliance-row { position: relative; margin-top: 10px; }
.treatment-appliance-row > .care-record { margin-top: 0; }
.treatment-appliance-edit-button { display: none; position: absolute; top: 4px; right: 10px; min-height: 34px; white-space: nowrap; }
.treatment-appliance[open] + .treatment-appliance-edit-button { display: inline-flex; align-items: center; }
.treatment-appliance[open] > summary { padding-right: 112px; min-height: 42px; }
.treatment-appliance-edit { margin-bottom: 12px; padding: 10px 0 12px; border-bottom: 1px solid var(--tdc-line); }
.treatment-appliance-edit[hidden] { display: none; }
.treatment-appliance[open] > summary .treatment-appliance-next { display: none; }
.treatment-disclosure { margin-top: 0; border-top: 1px solid var(--tdc-line); }
.treatment-disclosure > summary { padding-block: 10px; }
.treatment-disclosure > .checkbox-label { margin: 0 0 12px; }
.treatment-add-appliance { margin-top: 12px; }
.treatment-add-appliance > summary { padding-block: 5px; color: #075b78; }
.treatment-appliance-details { padding: 2px 8px 8px; }
.guided-pricing, .guided-step-head { display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.cost-agreement-panel { padding: 12px; border: 1px solid #d6e4ef; border-radius: 8px; background: #f6faff; }
.guided-pricing { align-items: center; border-top: 1px solid var(--tdc-line); padding: 9px 0; font-size: 13px; }
.guided-pricing .card-subtitle { display: block; margin: 2px 0 0; }
.guided-pricing .text-button { min-height: 30px; }
.guided-steps { padding-left: 23px; margin: 0 0 10px; }
.guided-next-step { list-style: none; padding-left: 0; }
.guided-step { margin-bottom: 3px; border: 1px solid transparent; border-bottom-color: #d6e4ef; border-radius: 4px; }
.guided-step[aria-current="step"] { border-color: #78a9bf; border-radius: 8px; background: #f0f8fc; }
.guided-step::marker { color: #54778a; font-variant-numeric: tabular-nums; font-weight: 700; }
.guided-step > details > summary { cursor: pointer; color: #1a4964; padding: 7px 8px; }
.guided-step > details > summary:hover { background: #ecf5fb; }
.guided-step-head { display: inline-flex; vertical-align: middle; width: calc(100% - 20px); align-items: center; }
.guided-step-description { padding: 0 10px 10px 23px; }
.guided-step-description .care-inline { justify-content: flex-start; }
.guided-step-description .text-button { min-height: 32px; }
.cost-agreement-panel h4 { margin: 0; }
.guided-step-head small { font-weight: 500; color: #425d70; }
.guided-step p { margin: 5px 0 8px; }
.guided-step .care-inline { justify-content: flex-start; }
.guided-step .care-inline:empty { display: none; }
.cost-agreement-panel { margin-block: 12px; }
.cost-agreement-panel.needs-action { border-color: #dfb56c; background: #fff8e8; }
.cost-prior-versions { list-style: none; padding-left: 0; }
.cost-prior-versions li { margin-bottom: 7px; }
.patient-cost-agreements { grid-column: 1 / -1; }
.guided-public-appliance { margin-top: 12px; border-top: 1px solid #d6e4ef; padding-top: 9px; }
.guided-public-appliance h3 { margin-top: 0; }
[data-step-booking][hidden], [data-slot-booking][hidden] { display: none; }
.schedule-view-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.schedule-view-picker button { display: inline-flex; align-items: center; gap: 6px; }
.schedule-controls { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: end; }
.schedule-controls .schedule-toolbar { margin: 0; }
.schedule-controls + p { margin: 9px 0 6px; }
.schedule-week-timeline { max-height: min(61vh, 650px); overflow: auto; border: 1px solid #c7dbe7; border-radius: 9px; background: #fff; }
.schedule-week-table { table-layout: fixed; width: 100%; min-width: 740px; border-collapse: separate; border-spacing: 0; }
.schedule-week-table :is(th, td) { padding: 0; border-right: 1px solid #d2e1ea; border-bottom: 1px solid #d2e1ea; }
.schedule-week-table thead th { position: sticky; top: 0; z-index: 2; height: 45px; background: #f0f5fa; text-align: center; }
.schedule-week-table thead th:first-child { width: 76px; font-size: 12px; }
.schedule-week-day .text-button { min-height: 40px; padding: 3px 6px; font-size: 13px; font-weight: 750; }
.schedule-week-day.is-today, .schedule-month-day.is-today { border-color: #08718f; background: #e3f5fc; }
.schedule-week-table tbody tr { height: 47px; }
.schedule-day-count { display: block; margin: 0 0 5px; font-size: .83rem; }
.schedule-week-day .schedule-day-count { margin: 0; font-size: .7rem; }
.schedule-week-block strong, .schedule-week-block span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schedule-week-table tbody th { padding: 2px 6px; background: #f5f8fb; text-align: right; vertical-align: top; color: #37556c; font-size: 12px; white-space: nowrap; }
.schedule-week-cell { position: relative; vertical-align: top; }
.schedule-week-cell.is-past { background: #f4f7fb; }
.schedule-week-cell.is-open { background: #eaf7f5; border-left: 2px solid #8dc3b5; }
.schedule-week-cell.is-booked { background: #e4edf9; border-left: 2px solid #6084b2; }
.schedule-week-block { position: absolute; inset: 0; padding: 1px 4px; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; overflow: hidden; border: 0; background: transparent; color: #203c58; cursor: pointer; font: inherit; text-align: left; line-height: 1.3; font-size: 12px; }
.schedule-week-cell.is-open .schedule-week-block { color: #165449; }
.schedule-week-block:hover { background: #40809b1a; }
.schedule-week-block:focus-visible { outline-offset: -2px; }
.schedule-week-block span { display: block; }
.schedule-week-mobile { display: none; }
.schedule-week-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 10px 0; }
.schedule-week-strip button.button.small { display: grid; justify-content: center; gap: 0; min-width: 0; padding: 4px 1px; font-size: 12px; }
.schedule-week-strip [aria-current="date"] { background: #edf8fe; border-color: #08718f; }
.schedule-month h3 { margin: 0 0 8px; }
.schedule-booking { display: grid; gap: 3px; margin: 6px 0; padding: 7px; border-radius: 6px; background: #e9f0fa; font-size: 13px; overflow-wrap: anywhere; }
.schedule-booking.is-shared { background: #dff1ec; }
.schedule-booking[data-visit-kind] { border-inline-start: 3px solid var(--visit-accent, #7491aa); }
.schedule-week-cell.is-booked[data-visit-kind] { border-inline-start-color: var(--visit-accent, #6084b2); }
[data-visit-kind="consultation"] { --visit-accent: #397eaf; --visit-tint: #e0eef9; --visit-ink: #204f76; }
[data-visit-kind="impressions"] { --visit-accent: #168578; --visit-tint: #dcf3ed; --visit-ink: #1a594d; }
[data-visit-kind="bite"] { --visit-accent: #7c6333; --visit-tint: #fff0d4; --visit-ink: #644615; }
[data-visit-kind="try_in"] { --visit-accent: #7752a5; --visit-tint: #eee5f8; --visit-ink: #56377d; }
[data-visit-kind="fitting"] { --visit-accent: #3d854f; --visit-tint: #e1f0dc; --visit-ink: #2e633b; }
[data-visit-kind="adjustment"] { --visit-accent: #ae5c37; --visit-tint: #fbe7de; --visit-ink: #793d26; }
.portal-shell .schedule-visit-kind { background: var(--visit-tint); color: var(--visit-ink); justify-self: start; }
.schedule-week-block .schedule-intake-state { font-size: .64rem; padding: 1px 3px; }
.schedule-week-cell.is-blocked, .schedule-booking.schedule-blocked, .schedule-slot.is-blocked {
  background: repeating-linear-gradient(135deg, #ecedf2 0 7px, #e3e6ee 7px 14px);
  color: #35405a;
}
.schedule-week-cell.is-blocked, .schedule-booking.schedule-blocked { border-inline-start: 3px solid #767f92; }
.schedule-month-day.has-blocked-time { box-shadow: inset 0 -3px #767f92; }
.schedule-month-block-label { font-size: .67rem; overflow-wrap: anywhere; }
#schedule-block-dialog [hidden] { display: none; }
#schedule-block-dialog .checkbox-label { margin-block: 10px; }
.schedule-booking button { justify-self: start; padding: 0; }
.schedule-months { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
.schedule-month { min-width: 0; padding: 10px; border: 1px solid #d8e4ed; border-radius: 9px; }
.schedule-month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.schedule-week-label { text-align: center; font-size: 12px; font-weight: 700; }
.schedule-month-day, .schedule-slot { min-width: 0; display: grid; align-content: center; justify-items: center; border: 1px solid #e0eaf2; border-radius: 6px; color: #173652; background: #fff; font: inherit; min-height: 44px; }
.schedule-month-day { cursor: pointer; }
.schedule-month-day small { min-width: 17px; padding-inline: 3px; border-radius: 6px; background: #0a5e7e; color: #fff; line-height: 1.35; }
.schedule-time-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.appointment-start-time { min-width: 0; margin: 0; padding: 5px 9px 9px; border: 1px solid var(--ui-line); border-radius: 9px; }
.appointment-start-time legend { padding: 0 4px; font-size: 14px; font-weight: 700; }
.appointment-time-picker { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px; }
.appointment-time-picker label { margin: 0 0 4px; font-size: 13px; }
.appointment-time-picker select { font-variant-numeric: tabular-nums; }
.appointment-time-picker optgroup[data-time-period="morning"],
.appointment-start-time:has([data-time-period="morning"] option:checked) [name="startHour"] { background: #e4f3ee; color: #165449; }
.appointment-time-picker optgroup[data-time-period="afternoon"],
.appointment-start-time:has([data-time-period="afternoon"] option:checked) [name="startHour"] { background: #fff1d8; color: #6c4314; }
.schedule-slot { background: #f5f9fc; }
.schedule-slot.is-open { color: #084c62; background: #eaf7f6; }
button.schedule-slot.is-open { cursor: pointer; }
button.schedule-slot.is-open:hover, .schedule-month-day:hover { border-color: #08718f; background: #e6f5fa; }
.schedule-slot.is-booked { background: #e9edf6; color: #253f5d; }
.schedule-slot small { font-size: 12px; }
.schedule-day-bookings { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
@media (max-width: 900px) {
  .schedule-week-timeline { display: none; }
  .schedule-week-mobile { display: block; }
}
.office-actions-menu { position: relative; }
.office-more {
  display: grid; place-items: center; width: 36px; height: 36px; list-style: none; border: 1px solid #cbd9e3;
  border-radius: 8px; background: #f6f9fc; color: var(--tdc-navy); font-size: 22px; line-height: 1; cursor: pointer;
}
.office-more::-webkit-details-marker { display: none; }
.office-more:hover, .office-actions-menu[open] > .office-more { border-color: #77a4b8; background: #e4f4fa; }
.office-menu-items {
  position: absolute; z-index: 3; top: calc(100% + 5px); right: 0; width: max-content; min-width: 145px; max-width: 240px;
  padding: 5px; border: 1px solid #c8d9e5; border-radius: 9px; background: #fff; box-shadow: 0 10px 26px #17354826;
}
.office-menu-item {
  display: block; width: 100%; padding: 8px 9px; border: 0; border-radius: 5px; background: transparent;
  color: var(--tdc-navy); text-align: left; font-size: 14px; font-weight: 650; cursor: pointer;
}
.office-menu-item:hover { background: #eaf5fb; }
.office-menu-item:focus-visible { outline-offset: -2px; }
.office-menu-danger { color: #852525; }
.office-menu-danger:hover { background: #fcecef; }
.office-fee-dialog { width: min(760px, calc(100% - 28px)); max-height: calc(100% - 28px); }
.office-fee-dialog::backdrop { background: #082e4f88; }
.office-fee-dialog .fee-schedule-text { max-height: min(62vh, 640px); }
.payment-receipt-dialog { width: min(460px, calc(100% - 28px)); }
.payment-receipt-dialog::backdrop { background: #082e4f88; }
.payment-receipt-dialog .form-actions { flex-wrap: wrap; }
.payment-receipt-dialog [role="status"]:empty { display: none; }
.receipt-email-options { margin-block: 14px; padding: 12px; border: 1px solid var(--ui-line); border-radius: 9px; }
.receipt-email-options fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.receipt-email-options .checkbox-label { overflow-wrap: anywhere; }
.receipt-email-options [hidden] { display: none; }
.payment-receipt-dialog > .receipt-activity { margin-block: 10px 14px; }

@media (max-height: 659px) {
  .office-chart-header:has(#chart-billing-tab[aria-selected="true"]) { position: sticky; top: 0; z-index: 2; }
  .office-chart-header:has(#chart-billing-tab[aria-selected="true"]) .office-chart-facts { display: none; }
}

@media (max-width: 860px) {
  .office-patients-grid, .office-patients-grid.has-open-chart { grid-template-columns: minmax(0, 1fr); }
  .office-directory { position: static; }
  .office-directory-results { max-height: 35vh; }
}
@media (min-height: 660px) {
  .office-chart-header { position: sticky; top: 8px; z-index: 2; box-shadow: 0 4px 16px #002e5d18; }
  .office-chart :is(summary, #staff-note, #treatment-plan-title) { scroll-margin-top: 224px; }
}
@media (max-width: 700px) {
  .office-tabs-chart { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 4px; }
  .office-tabs-chart button { grid-column: span 2; min-width: 0; min-height: 40px; white-space: normal; }
  .office-tabs-chart :is(#chart-treatment-tab, #chart-notes-tab) { grid-column: span 3; }
  .chart-tab-divider { grid-column: 1 / -1; height: 1px; margin: 2px 0; }
}
@media (max-width: 580px) {
  .office-chart-header:has(#chart-treatment-tab[aria-selected="true"]) { position: static; }
  #chart-treatment-panel :is(summary, #treatment-plan-title) { scroll-margin-top: 12px; }
  .office-workspace-bar { flex-wrap: nowrap; align-items: flex-start; gap: 6px; }
  .office-workspace-bar .office-tabs-office { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .office-workspace-bar .office-tabs-office button { padding: 7px 3px; min-width: 0; min-height: 40px; font-size: 13px; }
  .office-tabs-chart button { padding: 6px 2px; font-size: 13px; }
  .office-chart .chart-task { min-height: 38px; }
  .office-chart-buttons { gap: 5px; }
  .schedule-controls .schedule-toolbar { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  .schedule-date-control { grid-column: 1 / -1; grid-row: 1; }
  .office-directory { padding: 15px; }
  .office-tabs button { min-height: 39px; }
  .office-portal .office-chart-header, .office-chart > .office-pane > .card { padding-inline: 14px; }
  .office-chart-top { flex-wrap: wrap; }
  .office-chart-top .patient-head { flex-basis: 100%; }
  .office-chart-top .patient-avatar { width: 45px; height: 45px; }
  .office-chart-top #clear-patient { margin-left: auto; padding-inline: 8px; }
  .office-portal #portal-content :is(.office-directory-row .button, #clear-patient, .office-more) { min-height: 42px; }
  .office-more { width: 42px; }
  .office-portal .topbar-right { gap: 7px; }
  .office-portal .topbar-right .account-label { display: none; }
  .office-portal .topbar-right .button { padding-inline: 9px; }
}
@media (max-width: 400px) {
  .office-tabs-chart button { flex-direction: column; text-align: center; line-height: 1.2; }
}

@media screen {
  :is(.login-shell, .portal-shell, .payment-receipt-dialog) {
    --clinic-navy: #102637;
    --clinic-deep: #142e43;
    --clinic-teal-deep: #23525e;
    --clinic-teal: #327b7e;
    --clinic-mint: #afe0d8;
    --clinic-canvas: #eef2f0;
  }
  :is(.login-shell, .portal-shell, .lab-page) {
    --tdc-ink: var(--ui-ink);
    --tdc-muted: var(--ui-muted);
    --tdc-line: var(--ui-line);
  }
  :is(.login-shell, .portal-shell) { --tdc-navy: var(--ui-navy); }
  :is(.login-shell, .portal-shell, .lab-page) .button { border-radius: 9px; transition: background-color .15s, border-color .15s, box-shadow .15s; }
  :is(.login-shell, .portal-shell, .lab-page) .button:hover { filter: none; transform: none; }
  :is(.login-shell, .portal-shell, .lab-page) .button.outline { border-color: var(--ui-control); }
  :is(.login-shell, .portal-shell, .lab-page) .button.outline:hover { background: var(--ui-soft); border-color: var(--ui-action); }
  :is(.login-shell, .portal-shell) .button.primary { background: var(--ui-action); color: #fff; }
  :is(.login-shell, .portal-shell) .button.primary:not(:disabled):hover { background: var(--ui-action-hover); }
  :is(.login-shell, .portal-shell) .button.quiet { background: var(--ui-tint); }
  :is(.login-shell, .portal-shell, .lab-page) :is(input:not([type="checkbox"], [type="radio"]), select, textarea) {
    border-color: var(--ui-control); box-shadow: 0 1px 2px #1e3b4b0a; border-radius: 9px;
  }
  :is(.login-shell, .portal-shell, .lab-page) :is(input, select, textarea):focus { border-color: var(--ui-focus); }
  :is(.login-shell, .portal-shell, .lab-page) :is(input[type="checkbox"], input[type="radio"]) { accent-color: var(--ui-action); }
  :is(.portal-shell, .lab-page) .card { border-radius: var(--ui-radius); border-color: var(--tdc-line); box-shadow: var(--ui-shadow); }
  :is(.portal-shell, .lab-page) dialog.card { box-shadow: 0 18px 55px #152c4040; }
  :is(.portal-shell, .lab-page) .topbar { border-bottom-color: var(--tdc-line); }

  .login-shell { min-height: calc(100svh - 30px); background: var(--clinic-canvas); }
  .login-aside {
    isolation: isolate; padding: clamp(34px, 5vw, 80px);
    background: radial-gradient(ellipse at right bottom, var(--clinic-teal) 0%, var(--clinic-teal-deep) 35%, var(--clinic-deep) 68%, var(--clinic-navy) 100%);
  }
  .login-brand { position: relative; width: min(100%, 220px); text-align: center; }
  .login-logo-window { aspect-ratio: 718 / 234; overflow: hidden; }
  .login-logo-window .logo { width: 100%; max-width: none; background: transparent; transform: translateY(-22%); }
  .login-aside .login-logo-window .logo, .portal-shell .topbar .brand img { filter: brightness(0) invert(1); }
  .login-attribution { margin: 2px 0 0; color: var(--ui-muted); font-size: 14px; font-weight: 600; }
  .login-aside .login-attribution { color: #d2e8e9; }
  .login-aside::after {
    z-index: -1; right: -260px; bottom: -390px; width: 820px; height: 820px;
    border-color: #c9f4ec63; box-shadow: 0 0 0 48px #c9f4ec0c, 0 0 0 100px #c9f4ec0b, 0 0 0 152px #c9f4ec0b;
  }
  .login-aside .eyebrow { color: #bbede5; }
  .aside-copy { padding: 56px 0; max-width: 560px; }
  .aside-copy h1 { font: 400 clamp(56px, 6.6vw, 101px)/.98 var(--ui-display); letter-spacing: -.06em; }
  .aside-copy h1 em { color: var(--clinic-mint); font: inherit; font-style: italic; }
  .aside-copy p { margin-top: 20px; color: #e0efef; line-height: 1.65; }
  .aside-foot { color: #d2e8e9; }
  .login-main { padding: clamp(24px, 4vw, 64px); }
  .login-card {
    width: min(100%, 470px); padding: clamp(23px, 3.4vw, 42px); border: 1px solid var(--ui-line);
    border-radius: 19px; background: #fff; box-shadow: 0 12px 38px #13344613;
  }
  .login-card .eyebrow { color: var(--ui-action); letter-spacing: .13em; }
  .login-card h2 { margin-top: 9px; font-size: clamp(29px, 3vw, 39px); line-height: 1.15; font-weight: 750; }
  .login-card form label { margin-top: 16px; }
  .login-card .login-brand--mobile { width: min(100%, 190px); margin-bottom: 24px; }
  .login-card .dev-note { margin-top: 16px; background: #f7f6f1; border-color: #eae5d7; color: #514d41; }

  .portal-shell { background: var(--clinic-canvas); }
  .portal-shell .topbar {
    background: linear-gradient(110deg, var(--clinic-navy), var(--clinic-deep) 45%, var(--clinic-teal-deep) 82%, var(--clinic-teal));
    border-bottom: 2px solid var(--clinic-mint);
  }
  .portal-shell .topbar .brand { width: clamp(140px, 22vw, 180px); min-width: 0; aspect-ratio: 718 / 234; }
  .portal-shell .topbar .brand img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
  .portal-shell .topbar .account-label { color: #e5f4f1; }
  .portal-shell .topbar .button.quiet { color: #fff; background: #10263755; border: 1px solid #bdede570; white-space: nowrap; }
  .portal-shell .topbar .button.quiet:hover { background: var(--clinic-navy); }
  .portal-shell .topbar :focus-visible { outline-color: var(--clinic-mint); }
  .payment-receipt-dialog { --tdc-navy: var(--clinic-deep); border-color: var(--ui-line); }
  .payment-receipt-dialog .button.primary { background: var(--ui-action); color: #fff; }
  .payment-receipt-dialog .button.primary:hover { background: var(--ui-action-hover); }
  .portal-shell :is(.eyebrow, .patient-payment-history summary) { color: var(--ui-action); }
  .portal-title-row h1, .card :is(h2, h3) { text-wrap: pretty; }
  .portal-shell .card h2, .portal-shell .card h3 { letter-spacing: -.022em; }
  .portal-shell .text-button, .portal-shell .file-download-link { color: var(--ui-action); }
  .portal-shell .notice { background: var(--ui-soft); color: var(--ui-muted); }
  .portal-shell .portal-footer { background: var(--clinic-deep); color: #d5e8e7; border-top-color: var(--clinic-mint); }
  .portal-shell .care-record[open] > summary { background: var(--ui-soft); }
  .portal-shell .care-tag, .portal-shell .badge:not(.warn, .neutral) { background: var(--ui-tint); color: #245660; }
  .portal-shell [data-treatment-steps] [data-step-label="Completed"] { background: #e0f1e4; color: #255938; }
  .portal-shell [data-treatment-steps] [data-step-label="Skipped"] { background: #fff0d5; color: #764b14; }
  .portal-shell [data-treatment-steps] [data-step-label="Upcoming"] { background: #e3edfb; color: #2b5186; }
  .portal-shell .guided-step[aria-current="step"] { background: #eaf5f3; border-color: #a9cec8; }
  .portal-shell .guided-step > details > summary:hover { background: #e2f1ef; }
  .portal-shell .schedule-controls {
    padding: 12px; border: 1px solid var(--ui-line); border-radius: 11px; background: var(--ui-soft);
  }
  .portal-shell .schedule-week-timeline { border-color: var(--ui-control); border-radius: 11px; }
  .portal-shell .schedule-week-table thead th { background: #edf2f4; }
  .portal-shell .schedule-week-table thead .is-today, .portal-shell .schedule-month-day.is-today { background: var(--ui-tint); }

  .office-portal #portal-content .button.primary { background: var(--clinic-deep); }
  .office-portal #portal-content .button.primary:not(:disabled):hover { background: var(--clinic-teal-deep); }
  .office-tabs-office { padding: 5px; background: #e3ebec; border-color: #d4e0e2; border-radius: 11px; }
  .office-tabs-chart { border-top: 1px solid var(--ui-line); padding-top: 4px; }
  .office-portal .office-chart-header {
    border-top-color: var(--ui-action);
    background: linear-gradient(108deg, #fff 45%, #edf6f4);
  }
  .office-chart .patient-name { font: 400 clamp(26px, 3.6vw, 39px)/1.05 var(--ui-display); letter-spacing: -.038em; }
  .office-chart .patient-avatar { background: var(--ui-tint); color: var(--ui-action); border-radius: 12px; }
  .office-chart .office-record-number { padding: 2px 6px; border-radius: 5px; background: var(--ui-tint); color: var(--ui-action); font-size: 12px; }
  .office-chart-facts { margin-top: 11px; }
  .office-chart .treatment-appliance > summary { font-size: 15px; }
  .office-chart-empty { background: #eaf0ef; border-color: #bfced2; }
  .office-directory-results .row { border-color: var(--ui-line); }
  .office-directory-row.is-selected .button.outline:hover { background: var(--ui-navy); color: #fff; }

  .portal-shell:not(.office-portal) .portal-content { max-width: 1120px; }
  .portal-shell:not(.office-portal) .portal-title-row h1 {
    font-family: var(--ui-display); font-weight: 400; font-size: clamp(36px, 5.5vw, 61px); line-height: 1.04;
  }
  .patient-overview { gap: 18px; }
  .patient-overview > .card { padding: clamp(19px, 3.4vw, 28px); }
  .patient-overview .patient-home-primary { background: #e4f1ef; border-color: #bdd5d3; border-top: 1px solid #bdd5d3; border-inline-start: 4px solid var(--ui-action); }
  .patient-overview .patient-balance { background: #fff; }
  .patient-overview .patient-balance-amount, .patient-overview .patient-appointment time { letter-spacing: -.035em; }
  .patient-information[open] > summary { border-bottom: 1px solid var(--ui-line); padding-bottom: 12px; }

  @media (max-width: 860px) {
    .login-main { align-items: start; padding-top: clamp(30px, 9vw, 72px); }
  }
  @media (max-width: 580px) {
    .login-main { padding-inline: 16px; }
    .patient-overview { gap: 12px; }
    .schedule-controls .schedule-toolbar .button.small { padding-inline: 7px; }
    .portal-shell:not(.office-portal) .portal-title-row { gap: 8px; align-items: center; }
  }
}

@media screen {
  .office-portal > .portal-content > .portal-title-row {
    position: absolute; width: 1px; height: 1px; min-height: 0; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
  .office-portal .office-workspace-actions { flex-wrap: nowrap; }
  .office-tabs-chart button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
  .office-chart .patient-name { font-size: clamp(28px, 4vw, 44px); }
  .office-chart .office-plan-text, #chart-notes-panel .office-note { max-width: 76ch; }
  :is(#treatment-plan-form, #staff-note-form, #treatment-form, #patient-update-form, #appointment-request-form) { max-width: 44rem; }
  .portal-shell .office-chart .treatment-appliance { border-radius: 11px; }
  .portal-shell .guided-step[aria-current="step"] { border: 0; border-inline-start: 3px solid #8dbab2; border-radius: 0 7px 7px 0; }
  .portal-shell .treatment-disclosure { border-radius: 0; }
  .guided-pricing + .treatment-disclosure { border-top: 0; }
  .portal-shell :is(time, .amount, .office-record-number) { font-variant-numeric: tabular-nums; }

  .patient-appointment .patient-visit-card { margin: 14px 0 16px; max-width: 34rem; }
  .patient-visit-card time { display: flex; align-items: center; gap: clamp(12px, 3vw, 23px); font-size: 16px; letter-spacing: 0; margin: 0; }
  .patient-visit-date { display: grid; place-items: center; min-width: 76px; padding: 10px 12px; border: 1px solid #c2d7d6; border-radius: 11px; background: #fff; }
  .patient-visit-date span { font-size: 13px; font-weight: 750; }
  .patient-visit-date strong { font-size: 34px; line-height: 1.05; font-weight: 650; }
  .patient-visit-time { display: grid; gap: 2px; }
  .patient-visit-time span { color: var(--ui-muted); font-size: 14px; font-weight: 600; }
  .patient-visit-time strong { font-size: clamp(19px, 4vw, 25px); }
  .patient-appointment .patient-visit-card p { margin: 9px 0 0; }

  .login-aside::before {
    content: ''; position: absolute; z-index: -1; width: 42%; right: 0; top: 24%; height: 110px;
    background: repeating-linear-gradient(to bottom, transparent 0 18px, #bceae538 18px 20px);
    clip-path: polygon(42% 0, 100% 0, 100% 100%, 0 100%);
  }

  @media (max-width: 580px) {
    .office-portal .office-workspace-bar { flex-wrap: wrap; }
    .office-portal .office-tabs-office { flex-basis: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .office-portal .office-tabs-office button { white-space: normal; flex-wrap: wrap; line-height: 1.2; }
    .office-tabs-practice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .office-tabs-practice button { flex-wrap: wrap; white-space: normal; min-width: 0; padding: 7px 4px; font-size: 13px; line-height: 1.2; }
    .office-portal .office-workspace-actions { margin-inline-start: auto; }
    .office-tabs-chart button { gap: 4px; }
  }
  @media (prefers-reduced-motion: no-preference) {
    .treatment-appliance[open] > .care-record-body { animation: ui-disclosure-in .16s ease-out; }
    @keyframes ui-disclosure-in { from { opacity: .65; transform: translateY(-3px); } }
  }
}
.intake-match-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: 1rem;
  margin-block: .75rem;
  overflow-wrap: anywhere;
}
.intake-match-comparison section {
  padding: .75rem;
  border: 1px solid var(--ui-line);
  border-radius: 8px;
}
.intake-match-comparison h4 { margin-top: 0; }
.intake-match-comparison dl { margin-block: .5rem; }
.intake-match-comparison dt { font-weight: 650; }
.intake-match-comparison dd { margin: 0 0 .35rem; }
.intake-match-candidate + .intake-match-candidate { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--ui-line); }
