:root { color-scheme: light; --ink: #232b2d; --muted: #5d6c70; --accent: #24b9d7; --green: #086b7c; --line: #dde8e9; --bg: #f5f9f9; --wash: #eaf8fa; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 "Avenir Next", Avenir, "Segoe UI", sans-serif; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, textarea { font: inherit; }
button, a, input, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.skip-link { position: absolute; top: 8px; left: 8px; z-index: 10; transform: translateY(-150%); background: white; padding: 12px 18px; border: 2px solid var(--green); }
.skip-link:focus { transform: translateY(0); }
.brand-strip { background: var(--wash); color: var(--green); text-align: center; padding: 9px 16px; font-size: 10px; font-weight: 600; letter-spacing: 2.5px; }
.brand-strip span { margin: 0 10px; }
.topbar { background: white; border-bottom: 1px solid var(--line); padding: 22px max(24px, calc((100vw - 1140px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 24px; color: var(--green); }
.brand:hover { text-decoration: none; }
.brand-wordmark { font-family: Georgia, "Times New Roman", serif; font-size: 44px; font-weight: 400; letter-spacing: -3px; line-height: 1; }
.brand-wordmark > span { color: var(--accent); }
.brand-sub { border-left: 1px solid var(--line); padding-left: 24px; font-size: 10px; letter-spacing: 2px; font-weight: 600; color: var(--muted); }
.topbar nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.topbar form { margin: 0; }
.link-button { border: 1px solid var(--line); border-radius: 3px; padding: 8px 16px; color: var(--green); background: white; cursor: pointer; }
.link-button:hover { background: var(--wash); }
.username { color: var(--muted); }
.container { max-width: 1140px; margin: 0 auto; padding: 44px 24px 64px; min-height: calc(100vh - 220px); }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.page-heading { margin-bottom: 28px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(30px, 4vw, 42px); line-height: 1.2; letter-spacing: -1px; margin: 8px 0 12px; font-weight: 400; }
h2 { margin: 0; font-size: 22px; font-weight: 500; letter-spacing: -.4px; }
h3 { font-size: 16px; margin: 0 0 8px; font-weight: 650; }
p { margin: 0 0 16px; }
.eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 1.8px; margin: 0 0 8px; color: var(--green); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.button { border: 1px solid var(--green); background: var(--green); border-radius: 3px; min-height: 44px; padding: 11px 20px; color: white; display: inline-flex; justify-content: center; align-items: center; font-size: 14px; font-weight: 600; line-height: 1.5; cursor: pointer; text-align: center; }
.button:hover { background: #064e5b; color: white; text-decoration: none; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.button.secondary { color: var(--green); background: white; border-color: var(--line); }
.button.secondary:hover { background: var(--wash); border-color: var(--green); }
.card { background: white; border: 1px solid var(--line); border-radius: 5px; padding: 28px; margin-bottom: 24px; box-shadow: 0 5px 24px #173e4605; scroll-margin-top: 24px; }
.search-form { display: flex; gap: 10px; margin-bottom: 28px; }
input:not([type="checkbox"]):not([type="hidden"]), textarea { display: block; width: 100%; min-height: 46px; border: 1px solid #b8cbce; border-radius: 3px; padding: 11px 13px; background: white; color: var(--ink); }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: #a13030; }
input[type="file"] { font-size: 14px; }
textarea { resize: vertical; min-height: 90px; }
label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; }
.helptext { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; }
.badge { padding: 4px 11px; background: var(--wash); border: 1px solid #cbe9ee; border-radius: 3px; color: var(--green); font-size: 12px; white-space: nowrap; }
.table-wrapper { overflow-x: auto; margin-top: 20px; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; padding: 12px; background: var(--bg); }
td { padding: 18px 12px; border-bottom: 1px solid var(--line); }
tbody tr:hover { background: #f5fbfc; }
td:last-child { text-align: right; white-space: nowrap; }
.patient-name { font-weight: 650; color: var(--ink); }
.empty { text-align: center; padding: 50px 15px; color: var(--muted); }
.empty h3 { color: var(--ink); }
.pagination { display: flex; justify-content: center; gap: 24px; margin-top: 24px; font-size: 14px; }
.back-link { display: inline-block; margin-bottom: 20px; font-size: 14px; }
.tabs { display: flex; gap: 28px; margin-bottom: 24px; border-bottom: 1px solid var(--line); padding-bottom: 16px; font-size: 14px; }
.tabs a { padding: 8px 0; border-bottom: 2px solid transparent; }
.tabs a:hover, .tabs a:focus-visible { border-bottom-color: var(--accent); text-decoration: none; }
.data-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin: 24px 0; }
dt { font-size: 12px; color: var(--muted); }
dd { margin: 4px 0 0; font-size: 15px; font-weight: 550; overflow-wrap: anywhere; }
.legal-heading { border-top: 1px solid var(--line); padding-top: 22px; margin-top: 24px; margin-bottom: 14px; }
.consent-row { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 14px 0; font-size: 14px; }
.history-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.history-item { padding: 18px; border-radius: 3px; background: var(--bg); border-left: 2px solid #cbe9ee; }
.clinical-text { font-size: 14px; overflow-wrap: anywhere; white-space: pre-wrap; }
.attachment { padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.attachment .clinical-text { margin-top: 8px; }
.file-link { display: inline-block; background: var(--wash); padding: 6px 10px; border-radius: 3px; margin-top: 10px; overflow-wrap: anywhere; max-width: 100%; }
.visit { margin-top: 16px; border: 1px solid var(--line); border-radius: 3px; }
.visit summary { display: flex; gap: 18px; align-items: center; cursor: pointer; padding: 18px; list-style: none; }
.visit summary::-webkit-details-marker { display: none; }
.visit-date { font-size: 13px; background: var(--wash); border-radius: 3px; padding: 6px 10px; color: var(--green); white-space: nowrap; }
.visit-reason { flex: 1; font-weight: 600; overflow-wrap: anywhere; }
.expand-icon { font-size: 20px; }
.visit[open] .expand-icon { transform: rotate(45deg); }
.visit-body { padding: 0 22px 22px; border-top: 1px solid var(--line); }
.visit-body > .section-heading:first-child { padding-top: 16px; margin-bottom: 20px; }
.visit-body > h3 { margin-top: 20px; }
.form-card { max-width: 800px; margin-left: auto; margin-right: auto; }
.form-card h1 { margin-bottom: 24px; }
.form-card form > p { margin-bottom: 22px; }
.form-actions { display: flex; gap: 12px; margin-top: 28px; }
.login-layout { display: grid; grid-template-columns: 1fr 1fr; max-width: 1000px; margin: 20px auto; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: white; }
.login-welcome { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 48px 40px; background: #e8f6f7; }
.login-welcome h2 { font: 400 clamp(32px, 4vw, 46px)/1.15 Georgia, "Times New Roman", serif; margin: 14px 0 20px; max-width: 320px; }
.login-welcome > p:not(.eyebrow) { color: #49666b; }
.balance-art { align-self: center; display: flex; flex-direction: column; align-items: center; gap: 7px; margin: 26px 0; width: 100%; }
.balance-art span { display: block; border-radius: 50% 45% 40% 48%; background: #96cbd0; height: 36px; width: 76px; transform: rotate(-8deg); }
.balance-art span:nth-child(2) { width: 115px; height: 46px; background: #65a9b4; transform: rotate(5deg); }
.balance-art span:nth-child(3) { width: 166px; height: 56px; background: #367d8a; transform: rotate(-3deg); }
.welcome-caption { align-self: center; font-size: 9px; letter-spacing: 2px; color: var(--green); margin-top: 16px; }
.login-card { width: 100%; min-width: 0; margin: 0; padding: 48px 40px; border: 0; border-radius: 0; box-shadow: none; }
.login-card form { margin: 28px 0; }
.full-width { width: 100%; }
.notice { background: var(--wash); color: #175363; padding: 14px 18px; border: 1px solid #c5e5ec; border-radius: 3px; margin-bottom: 20px; font-size: 14px; }
.notice.warning { background: #fff8e8; color: #795811; border-color: #f0dfb8; }
.notice.error { background: #fff2f0; border-color: #eccbc6; }
.notice.error, .errorlist { color: #a13030; }
.errorlist { list-style: none; padding: 0; font-size: 14px; }
.legal-document { padding: 22px; background: var(--bg); border: 1px solid var(--line); border-radius: 3px; font-size: 14px; margin-bottom: 24px; overflow-wrap: anywhere; white-space: pre-wrap; }
.checkbox-label { display: flex; align-items: flex-start; gap: 12px; }
.checkbox-label input { margin-top: 6px; width: 19px; height: 19px; flex-shrink: 0; accent-color: var(--green); }
.checkbox-label label { font-weight: 400; }
#signature-canvas { width: 100%; height: auto; display: block; background: white; border: 1px dashed #6d939b; border-radius: 3px; touch-action: none; margin: 12px 0; }
.signature-image { display: block; width: 100%; max-width: 500px; border: 1px solid var(--line); margin: 12px 0 24px; }
.footer { display: flex; justify-content: center; align-items: center; gap: 20px; flex-wrap: wrap; padding: 24px; text-align: center; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); background: white; }
.footer-brand { font: 26px Georgia, "Times New Roman", serif; letter-spacing: -1px; color: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 720px) {
  .topbar { padding: 16px; flex-wrap: wrap; }
  .brand-sub, .username { display: none; }
  .brand-wordmark { font-size: 38px; }
  .topbar nav { gap: 16px; flex-wrap: wrap; }
  .container { padding: 26px 16px 40px; }
  .card { padding: 20px; }
  .page-heading, .section-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; }
  .tabs { gap: 12px; flex-wrap: wrap; font-size: 12px; }
  .data-grid, .history-grid { grid-template-columns: 1fr; gap: 16px; }
  .search-form { flex-wrap: wrap; }
  .search-form input { flex-basis: 100%; }
  .visit summary { gap: 10px; padding: 14px; flex-wrap: wrap; }
  .visit-reason { flex-basis: 65%; font-size: 14px; }
  .consent-row { align-items: flex-start; flex-direction: column; }
  .login-layout { grid-template-columns: 1fr; margin: 0 auto; }
  .login-welcome { padding: 28px; }
  .login-welcome h2 { max-width: none; font-size: 32px; }
  .balance-art, .welcome-caption { display: none; }
  .login-card { padding: 28px; }
}
