:root{--primary:#00836c;--primary-pressed:#006b58;--on-primary:#fff;--secondary:#20254d;--accent:#374c74;--tint:#ebf1ff;--background:#fafafa;--surface:#fff;--subtle:#f1f1f1;--border:#dcdde0;--border-strong:#80858c;--text:#222;--text-secondary:#6d7278;--disabled:gray;--error:#b3261e;--error-tint:#fdecea;--warning:#8a5300;--warning-tint:#fff4d6;--overlay:#20254d73;color:var(--text);background:var(--background);font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}body{background:var(--background);margin:0;line-height:1.5}h1,h2,h3{color:var(--secondary)}a{color:var(--accent)}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}.sr-only{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}button,.button{cursor:pointer;border:1px solid var(--border-strong);background:var(--surface);min-height:48px;color:var(--accent);border-radius:8px;justify-content:center;align-items:center;gap:8px;padding:0 16px;font-size:1rem;text-decoration:none;transition:background-color .15s,border-color .15s;display:inline-flex}button:active,.button:active{background:var(--tint)}button.primary,.button.primary{background:var(--primary);border-color:var(--primary);min-height:56px;color:var(--on-primary);font-weight:600}button.primary:active{background:var(--primary-pressed);border-color:var(--primary-pressed)}button.danger{border-color:var(--error);color:var(--error)}button.outline{border:2px solid var(--primary);min-height:56px;color:var(--primary);background:var(--surface);font-weight:600}button:disabled{background:var(--subtle);border-color:var(--border);color:var(--disabled);cursor:default}input,textarea,select{font:inherit;border:1px solid var(--border-strong);box-sizing:border-box;background:var(--surface);width:100%;color:var(--text);border-radius:8px;padding:10px;font-size:1rem}select{min-height:48px}input[type=checkbox],input[type=radio]{accent-color:var(--primary)}label{margin:12px 0 4px;font-weight:600;display:block}label input,label textarea{margin-top:4px;font-weight:400}label.inline{align-items:center;gap:6px;margin:0;display:inline-flex}label.inline input{width:auto;margin:0}.brand{color:var(--secondary);align-items:center;gap:10px;font-size:1.25rem;font-weight:700;display:inline-flex}.brand-logo{object-fit:contain;width:auto;height:36px}.app-header{background:var(--surface);border-bottom:1px solid var(--border);flex-wrap:wrap;align-items:center;gap:24px;padding:8px 16px;display:flex}.app-nav{flex-wrap:wrap;flex:1;gap:16px;display:flex}.app-nav a{min-height:48px;color:var(--accent);align-items:center;gap:6px;padding:0 4px;text-decoration:none;display:inline-flex}.app-nav a.active{color:var(--secondary);box-shadow:inset 0 -3px 0 var(--primary);font-weight:700}.profile-button{align-items:center;min-height:48px;display:flex}.app-main{max-width:960px;margin:0 auto;padding:16px}.center{justify-content:center;padding-top:48px;display:flex}.sign-in{flex-direction:column;align-items:center;gap:24px}.page-head{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;display:flex}.detail-head{align-items:center;gap:16px;margin:16px 0;display:flex}.detail-head h1{overflow-wrap:anywhere;margin:0}.icon-button{flex:none;justify-content:center;width:48px;min-width:48px;height:48px;padding:0}.panel{background:var(--surface);border:1px solid var(--border);border-radius:12px;margin:16px 0;padding:16px}.card-list{padding:0;list-style:none}.card{background:var(--surface);border:1px solid var(--border);border-radius:12px;margin-bottom:12px;padding:12px 16px}.card-title{color:var(--accent);font-size:1.1rem;font-weight:700}.row-actions,.actions{flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;display:flex}.actions{margin-top:16px}.muted{color:var(--text-secondary)}.note{background:var(--tint);border:1px solid var(--border);border-radius:8px;margin:6px 0;padding:8px 12px;display:inline-block}.error{color:var(--error)}p.error,.error[role=alert]{align-items:flex-start;gap:6px;display:flex}.bilingual{margin-bottom:10px}.bilingual .hindi-label{color:var(--text-secondary);margin-top:4px}.hindi-text{font-family:Noto Sans Devanagari,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}.field-note.warn{color:var(--warning);font-size:.9rem}.review-box{min-height:48px;font-weight:600}.edit-rows{padding-left:20px}.edit-row{flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:10px;display:flex}.edit-row>input,.edit-row>textarea,.edit-row>.counted{flex:280px}.counted{flex-direction:column;display:flex}.char-count{color:var(--text-secondary);align-self:flex-end;margin-top:2px;font-size:.875rem;font-weight:400}.rows-head{flex-wrap:wrap;justify-content:space-between;align-items:baseline;gap:12px;display:flex}.row-count{color:var(--text-secondary)}.char-count.at-limit,.char-count.over-limit,.row-count.at-limit,.row-count.over-limit{color:var(--error);font-weight:600}.row-buttons{gap:6px;display:flex}button.touch{min-width:48px;min-height:48px;padding:0 12px}.touch-toggle{min-height:48px}.touch-toggle input{width:24px;height:24px}.english-label{margin:12px 0 2px}.english-text{white-space:pre-wrap;overflow-wrap:anywhere;margin:0 0 4px}.danger-zone{margin-top:24px}.no-surgeries p{font-size:1.2rem}.badge.warn{background:var(--warning-tint);color:var(--warning);border:1px solid var(--border);border-radius:12px;align-items:center;gap:8px;margin:4px 0;padding:2px 10px;font-size:.9rem;display:inline-flex}.patient{background:var(--background);-webkit-text-size-adjust:100%;font-size:1.15rem;line-height:1.5;position:fixed;inset:0;overflow-y:auto}.patient.lang-hi{font-family:Noto Sans Devanagari,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}.patient button,.patient select,.patient input,.patient textarea{min-height:48px;font-size:1.1rem}.patient button.primary{min-height:56px}.patient-header{z-index:2;padding:8px 16px;padding-top:max(8px, env(safe-area-inset-top));background:var(--surface);border-bottom:1px solid var(--border);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:12px;display:flex;position:sticky;top:0}.header-actions{align-items:center;gap:12px;display:flex}.language-toggle{border:1px solid var(--border-strong);border-radius:8px;display:inline-flex;overflow:hidden}.language-toggle button{border:none;border-radius:0;min-width:56px;font-weight:600}.language-toggle button+button{border-left:1px solid var(--border-strong)}.language-toggle button[aria-pressed=true]{background:var(--primary);color:var(--on-primary)}.staff-exit{color:var(--text-secondary);font-size:.95rem!important}.patient-main{max-width:960px;padding:16px 16px calc(120px + env(safe-area-inset-bottom));margin:0 auto}.stepper ol{gap:4px;margin:0 0 16px;padding:0;list-style:none;display:flex}.stepper .stage{flex:1;min-width:0}.stepper .stage button{border:none;border-bottom:4px solid var(--subtle);width:100%;min-height:56px;color:var(--text-secondary);background:0 0;border-radius:8px 8px 0 0;flex-direction:column;gap:2px;padding:6px 4px;font-size:.9rem}.stepper .stage.done button{color:var(--primary);border-bottom-color:var(--primary)}.stepper .stage.current button{color:var(--secondary);background:var(--tint);border-bottom-color:var(--primary);font-weight:700}.stepper .stage.upcoming button:disabled{background:var(--subtle);color:var(--disabled);border-bottom-color:var(--subtle)}.stage-label{text-overflow:ellipsis;white-space:nowrap;max-width:100%;overflow:hidden}@media (width<=719px){.stepper .stage:not(.current) .stage-label{clip:rect(0, 0, 0, 0);width:1px;height:1px;position:absolute;overflow:hidden}}.sub-tabs ol{border-bottom:2px solid var(--border);gap:4px;margin:0 0 12px;padding:0;list-style:none;display:flex}.sub-tab{flex:1}.sub-tab button{width:100%;min-height:48px;color:var(--text-secondary);background:0 0;border:none;border-bottom:3px solid #0000;border-radius:8px 8px 0 0;justify-content:center;gap:8px;margin-bottom:-2px;font-weight:600}.sub-tab.done button{color:var(--primary)}.sub-tab.current button{color:var(--secondary);border-bottom-color:var(--primary);background:var(--tint)}.sub-tab.upcoming button:disabled{color:var(--disabled);background:0 0}.sub-tab-check{flex:none}.patient .field{margin-bottom:16px}.patient .field label{margin-bottom:6px}.form-grid{grid-template-columns:1fr;column-gap:24px;display:grid}@media (orientation:landscape) and (width>=768px){.form-grid{grid-template-columns:1fr 1fr}.form-grid>.field:has([role=radiogroup]){grid-column:1/-1}}.field-error{color:var(--error);margin:6px 0 0;font-weight:600}.banner{background:var(--tint);border:1px solid var(--border);border-left:4px solid var(--accent);border-radius:8px;padding:12px 16px;font-weight:600}.banner p{margin:0 0 4px}.action-bar{z-index:2;background:var(--surface);border-top:1px solid var(--border);padding:12px 16px calc(12px + env(safe-area-inset-bottom));position:fixed;bottom:0;left:0;right:0}.action-bar-inner{justify-content:space-between;gap:16px;max-width:960px;margin:0 auto;display:flex}.action-bar button{min-width:140px;min-height:56px}.group-label{margin:0 0 6px;font-weight:600}.choices{gap:12px;display:grid}.choices-row{grid-template-columns:repeat(auto-fit,minmax(160px,1fr))}.choice{text-align:left;min-height:64px;color:var(--text);border:2px solid var(--border-strong);border-radius:12px;justify-content:flex-start;padding:12px 16px;font-size:1.2rem}.choices-row .choice{text-align:center;justify-content:center}.choice.selected{border-color:var(--primary);background:var(--tint);font-weight:700}.surgery-cards{grid-template-columns:1fr;gap:16px;display:grid}@media (width>=600px){.surgery-cards{grid-template-columns:repeat(2,1fr)}}@media (orientation:landscape) and (width>=1000px){.surgery-cards{grid-template-columns:repeat(3,1fr)}}.surgery-card{text-align:left;min-height:96px;color:var(--text);background:var(--surface);border:2px solid var(--border);border-radius:12px;flex-direction:column;justify-content:flex-start;align-items:stretch;gap:6px;padding:16px 20px}.surgery-card.selected{border-color:var(--primary);background:var(--tint)}.surgery-card-head{justify-content:space-between;align-items:flex-start;gap:8px;display:flex}.surgery-card-name{color:var(--secondary);font-size:1.2rem;font-weight:700}.surgery-card-check{color:var(--primary);flex:none}.surgery-card-preview{color:var(--text-secondary);overflow-wrap:anywhere;-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:.875rem;line-height:1.6;display:-webkit-box;overflow:hidden}.tick-counter{color:var(--secondary);font-weight:600}.consent-items{gap:12px;display:grid}.consent-item{background:var(--surface);border:2px solid var(--border);cursor:pointer;border-radius:12px;align-items:flex-start;gap:16px;min-height:64px;margin:0;padding:12px;font-weight:400;display:flex}.consent-item.checked{border-color:var(--primary);background:var(--tint)}.consent-item input[type=checkbox]{flex:none;width:32px;height:32px;min-height:32px;margin:8px}.signature-area{position:relative}.signature-canvas{border:2px solid var(--border-strong);background:var(--surface);touch-action:none;border-radius:12px;width:100%;height:min(45vh,320px);margin-bottom:8px;display:block}.signature-hint{border-top:2px solid var(--border);color:var(--text-secondary);pointer-events:none;padding-top:4px;font-size:.95rem;position:absolute;bottom:40px;left:24px;right:24px}.signature.locked .signature-canvas{background:var(--subtle);border-style:dashed}.signature-locked{color:var(--text-secondary);pointer-events:none;justify-content:center;align-items:center;margin-bottom:8px;font-weight:600;display:flex;position:absolute;inset:0}.pin-boxes{gap:12px;margin:8px 0;display:flex}.patient .pin-boxes input{text-align:center;width:56px;min-height:56px;font-size:1.5rem}.doctor-notes{color:var(--text-secondary);margin:8px 0 16px;padding-left:0;list-style:none}.tick-hint{color:var(--text-secondary);margin:0 0 8px}.signature-label,.signer-name{font-weight:600}.summary{grid-template-columns:minmax(120px,30%) 1fr;gap:8px 16px;display:grid}.summary dt{color:var(--secondary);font-weight:600}.summary dd{word-break:break-word;margin:0}.signature-thumbs{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;display:grid}.signature-thumb{min-width:0;margin:0}.signature-box{aspect-ratio:2;background:var(--surface);border:1px solid var(--border-strong);border-radius:8px;justify-content:center;align-items:center;display:flex;overflow:hidden}.signature-box img{object-fit:contain;width:100%;height:100%;display:block}.signature-fallback{text-align:center;color:var(--text-secondary);margin:0;padding:8px;font-size:.875rem}.signature-thumb figcaption{text-align:center;margin-top:4px;font-weight:600}.spinner{animation:1s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.dialog-backdrop{z-index:3;background:var(--overlay);justify-content:center;align-items:center;padding:16px;display:flex;position:fixed;inset:0}.dialog{background:var(--surface);border-radius:12px;width:min(420px,100%);padding:20px}.dialog h2{align-items:center;gap:8px;display:flex}@media (orientation:landscape) and (height<=600px){.signature-canvas{height:180px}}.consent-list{margin-top:16px}.consent-list .search{margin-bottom:12px}.table-scroll{-webkit-overflow-scrolling:touch;border:1px solid var(--border);border-radius:8px;min-height:200px;max-height:calc(100dvh - 240px);overflow:auto}.table-scroll:focus-visible{outline:3px solid var(--accent);outline-offset:2px}.consents-table thead th{z-index:1;background:var(--surface);box-shadow:inset 0 -1px 0 var(--border);position:sticky;top:0}.consents-table .col-patient{min-width:260px}.consents-table .col-tags{min-width:160px}.consents-table{border-collapse:collapse;background:var(--surface);width:100%}.consents-table th,.consents-table td{text-align:left;border-bottom:1px solid var(--border);vertical-align:top;padding:10px 8px}.consents-table th{color:var(--secondary)}.consents-table td:first-child{white-space:nowrap}.consents-table tbody tr.row-link{cursor:pointer}.consents-table tbody tr.row-link:active{background:var(--tint)}@media (hover:hover){.consents-table tbody tr.row-link:hover{background:var(--tint)}}.consents-table tbody tr.row-link:focus-visible{outline:3px solid var(--accent);outline-offset:-3px;background:var(--tint)}.consents-table a{overflow-wrap:anywhere;min-height:32px;font-weight:600;display:inline-block}.pagination{flex-wrap:wrap;justify-content:space-between;align-items:center;gap:8px;margin-top:12px;display:flex}.consent-detail h1{overflow-wrap:anywhere}.consent-detail h2{margin-top:0;font-size:1.15rem}.pre-line{white-space:pre-line}.accepted-items{padding:0;list-style:none}.accepted-items li{margin-bottom:8px}.accepted-items .tick{color:var(--primary);font-weight:700}.signature-preview{background:var(--surface);border:1px solid var(--border);border-radius:8px;max-width:100%;max-height:160px;padding:4px;display:block}.signature-draft{margin:12px 0}.sign-mode{border:1px solid var(--border);border-radius:8px;margin-top:16px;padding:8px 12px}.sign-mode label.inline{min-height:48px;margin:6px 16px 6px 0}@media (prefers-reduced-motion:reduce){*,:before,:after{transition:none!important;animation:none!important}}.still-saving{color:var(--text-secondary);margin:16px 0 0;font-weight:600}.tag-chips{flex-wrap:wrap;gap:8px;margin:0 0 8px;padding:0;list-style:none;display:flex}.tag-chip{border:1px solid var(--border);background:var(--tint);border-radius:999px;align-items:center;gap:2px;max-width:100%;padding:2px 10px;display:inline-flex}.tag-chip-text{overflow-wrap:anywhere}.tag-chip:has(.tag-remove){padding-right:0}.tag-remove{min-width:44px;min-height:44px;color:var(--text-secondary);background:0 0;border:none;border-radius:999px;justify-content:center;align-items:center;padding:0;display:inline-flex}.tags-field{margin-top:16px}.tags-meta{justify-content:space-between;gap:12px;margin-top:4px;display:flex}.tags-counter{color:var(--text-secondary);white-space:nowrap}.consents-table .tag-chips{margin:0}.letterhead-layout{flex-wrap:wrap;align-items:flex-start;gap:24px;margin-top:16px;display:flex}.letterhead-controls{flex:260px}.mm-control{margin-bottom:16px}.mm-row{align-items:center;gap:8px;margin:4px 0;display:flex}.mm-row input[type=number]{width:96px}.mm-step{justify-content:center;align-items:center;min-width:48px;min-height:48px;padding:0;display:inline-flex}.mm-control input[type=range]{width:100%;min-height:32px}.letterhead-preview{flex:0 240px;margin:0}.letterhead-preview .a4{aspect-ratio:210/297;border:1px solid var(--border-strong);background:var(--surface);width:100%;position:relative;overflow:hidden}.letterhead-preview .strip{position:absolute;left:0;right:0;overflow:hidden}.letterhead-preview .strip-header{top:0}.letterhead-preview .strip-footer{bottom:0}.letterhead-preview .strip-image{aspect-ratio:210/297;object-fit:fill;width:100%;height:auto;position:absolute;left:0}.letterhead-preview .strip-header .strip-image{top:0}.letterhead-preview .strip-footer .strip-image{bottom:0}.letterhead-preview .a4.no-image .strip{background:var(--subtle)}.letterhead-preview .content-area{border:1px dashed var(--accent);background:var(--surface);flex-direction:column;gap:6px;padding:6px 0;display:flex;position:absolute;left:6.67%;right:6.67%;overflow:hidden}.letterhead-preview .sample-line{background:var(--border-strong);border-radius:2px;height:4px;display:block}.letterhead-preview figcaption{color:var(--text-secondary);margin-top:4px;font-size:.9rem}.letterhead-switch{margin-top:16px}.switch{align-items:center;gap:12px;min-height:48px;display:inline-flex}.switch-track{background:var(--border-strong);border-radius:12px;width:44px;height:24px;display:inline-block;position:relative}.switch-thumb{background:var(--surface);border-radius:50%;width:18px;height:18px;position:absolute;top:3px;left:3px}.switch[aria-checked=true] .switch-track{background:var(--primary)}.switch[aria-checked=true] .switch-thumb{left:23px}.switch:disabled .switch-track{background:var(--disabled)}.app-error{text-align:center;background:var(--background);min-height:100dvh;color:var(--text);flex-direction:column;justify-content:center;align-items:center;gap:12px;padding:24px 16px;font-size:1.1rem;display:flex}.app-error p{margin:0}
