:root{font-family:"Yu Gothic UI","Hiragino Kaku Gothic ProN","Meiryo",system-ui,sans-serif;color:#0F172A;background:#F1F5F9;font-size:12px}
*{box-sizing:border-box}html,body{margin:0;min-width:0}body{padding:4px}.application{width:min(350px,100%);margin:0 auto;min-width:0}.native-window{width:100%;height:auto;display:grid;gap:4px;min-width:0}
.native-toolbar{height:26px;display:grid;grid-template-columns:minmax(0,1fr) 64px 64px;gap:4px;align-items:center;padding:0 4px}.native-toolbar strong{font-size:15px;line-height:22px;min-width:0;white-space:nowrap}.native-toolbar .button{height:26px}
.button{min-width:0;border:0;border-radius:10px;background:#F1F5F9;color:#334155;font:11.5px "Yu Gothic UI","Hiragino Kaku Gothic ProN","Meiryo",sans-serif;cursor:pointer;white-space:nowrap;padding:0 4px;line-height:normal}.button.primary{background:#1D4ED8;color:#fff;font-weight:700}.button.blue{background:#DBEAFE;color:#1E3A8A;font-weight:700}.button:hover:enabled{filter:brightness(.95)}.button:active:enabled{filter:brightness(.89)}.button:disabled{background:#E2E8F0;color:#475569;cursor:default}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid #2563EB;outline-offset:1px}
.patient-card{display:grid;grid-template-columns:minmax(0,.37fr)minmax(0,.63fr);grid-template-rows:12px 32px 22px;gap:3px 6px;background:#E8EFF8;border-radius:12px;padding:6px;min-width:0}.patient-card label{font-size:10.5px;color:#475569;line-height:12px}.case-label{grid-area:1/1}.animal-label{grid-area:1/2}.patient-card input{min-width:0;width:100%;height:32px;border:1px solid #E2E8F0;border-radius:11px;background:#fff;color:#0F172A;padding:0 8px;font:14px "Yu Gothic UI","Hiragino Kaku Gothic ProN",sans-serif}#case-id{grid-area:2/1}#animal-name{grid-area:2/2}.patient-card input:focus{border-color:#2563EB;outline:1px solid #2563EB}.mic-label{grid-area:3/1;align-self:center}#microphone{grid-area:3/1/4/3;margin-left:42px;width:calc(100% - 42px);min-width:0;height:22px;background:#E8EFF8;border:1px solid #D4DEEB;border-radius:8px;color:#334155;font:11px "Yu Gothic UI",sans-serif;padding:0 5px}
.record-card{display:grid;grid-template-columns:minmax(0,1fr)minmax(0,.74fr)minmax(0,1.24fr);grid-template-rows:14px 34px;gap:4px;background:#fff;border-radius:12px;padding:6px;min-width:0}.record-line{grid-column:1/-1;font-size:10.5px;line-height:14px;color:#475569;min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}#native-timer{float:right;font-variant-numeric:tabular-nums}.dot{display:none}.record-card .button{height:34px}#start{grid-area:2/1}#pause{grid-area:2/2}#stop{grid-area:2/3}.record-card #start-help{grid-column:1/-1;margin:0;font-size:11px;line-height:14px;overflow-wrap:anywhere}.recording-blocked{color:#991b1b}.recording-ready{color:#166534}
.audio-card{display:grid;grid-template-columns:78px minmax(0,1fr)80px;gap:6px;align-items:center;background:#fff;border-radius:12px;padding:6px;min-width:0}.audio-card .button{height:30px}#audio-path{min-width:0;width:100%;height:22px;border:0;background:transparent;font:11px "Yu Gothic UI",sans-serif;color:#0F172A;text-overflow:ellipsis}
.status-card{display:grid;grid-template-columns:28px minmax(0,1fr)16px;grid-template-rows:26px 3px;gap:3px;background:#fff;border-radius:12px;padding:4px 6px;min-width:0}.status-card label{font-size:11px;line-height:16px}.result{min-width:0;width:100%;height:26px;font-size:11px;line-height:13px;white-space:normal;overflow:hidden;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.result.error{color:#991B1B}.result.success{color:#166534}.result.recovered{color:#92400E}#status-detail{min-width:0;padding:0;border:0;background:none;color:#475569;cursor:pointer;align-self:start;line-height:20px}#native-progress{grid-column:1/-1;width:100%;height:3px;accent-color:#1D4ED8;border:0}
.review-card{border-radius:12px;background:#E8EFF8;font-size:10px;line-height:13.5px;padding:5px 8px;color:#0F172A;overflow-wrap:anywhere}
.pwa-status{display:flex;gap:4px;align-items:center;min-width:0;height:18px;margin-top:2px;font-size:9.5px;color:#475569}.pwa-status img{flex:none;width:14px;height:14px}.pwa-status #provider-mode{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pwa-status button{flex:none;max-width:64px;min-width:0;padding:0;border:0;background:none;color:#475569;cursor:pointer;text-align:left;font:inherit;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
dialog{width:min(520px,calc(100vw - 12px));max-height:calc(100dvh - 12px);overflow-y:auto;overflow-x:hidden;border:1px solid #CBD5E1;border-radius:14px;padding:12px;background:#F1F5F9;color:#0F172A;font-size:13px}dialog::backdrop{background:#0F172A55}dialog header{display:flex;justify-content:space-between;align-items:center;gap:8px}dialog h2{font-size:16px;margin:0;min-width:0;overflow-wrap:anywhere}dialog button{min-height:30px;padding:5px 10px;max-width:100%}dialog header button{flex:none;border:0;background:#E2E8F0;border-radius:8px;cursor:pointer}dialog details{background:#fff;border-radius:10px;padding:8px;margin:8px 0}summary{cursor:pointer;font-weight:700}dialog p{line-height:1.6;overflow-wrap:anywhere}dialog input,dialog select{width:100%;min-width:0;max-width:100%;min-height:30px;border:1px solid #CBD5E1;border-radius:8px;padding:5px;font:inherit}#enroll-form{display:grid;gap:5px;margin:10px 0}#sessions{width:100%}#terms-list{max-height:270px;overflow:auto;background:#fff;border-radius:8px;padding:12px 25px}#result-detail{white-space:pre-wrap;overflow-wrap:anywhere;max-width:100%;font:inherit}textarea#saved-document{display:block;width:100%;margin-top:10px;padding:8px;border:1px solid #CBD5E1;border-radius:8px;font:13px "Yu Gothic UI",sans-serif;line-height:1.6;background:#fff;color:#0F172A}[hidden]{display:none!important}
@media(max-height:400px){body{padding:2px 4px}.native-window{gap:3px}.native-toolbar{height:22px}.native-toolbar .button{height:22px}.patient-card{padding:5px;grid-template-rows:11px 28px 20px;row-gap:2px}.patient-card input{height:28px}.patient-card label{font-size:10px;line-height:11px}#microphone{height:20px}.record-card{grid-template-rows:13px 30px;gap:3px;padding:5px}.record-card .button{height:30px}.audio-card{padding:5px}.audio-card .button{height:26px}.status-card{grid-template-rows:24px 3px;gap:2px}.result{height:24px;line-height:12px}.review-card{font-size:9.5px;line-height:12px;padding:4px 6px}.pwa-status{height:16px}}
.usage-card{display:grid;grid-template-columns:minmax(0,1fr);min-height:30px;align-items:center;background:#E8EFF8;border-radius:10px;padding:3px 6px;min-width:0}.usage-lines{min-width:0;font-size:10px;line-height:12px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}.usage-card output{font-weight:700}
@media(max-height:400px){.patient-card{padding:4px;grid-template-rows:10px 26px 18px}.patient-card input{height:26px}.patient-card label{line-height:10px}#microphone{height:18px}.record-card{padding:4px;grid-template-rows:13px 28px}.record-card .button{height:28px}.review-card{font-size:9px;line-height:11.5px;padding:3px 6px}.usage-card{padding:2px 6px;min-height:27px}.usage-lines{line-height:11.5px}}
@media(max-width:300px){.native-toolbar{grid-template-columns:minmax(0,1fr) 56px 56px;gap:3px}.native-toolbar strong{font-size:14px}.button{font-size:10.5px}.audio-card{grid-template-columns:70px minmax(0,1fr)72px;gap:4px}.usage-lines{font-size:9px}}

/* Royal blue and white: approved compact clinical theme. Visual rules only. */
:root{color:#1c3e72;background:#edf3ff}
body{padding:2px;background:#edf3ff}
.application{width:min(376px,100%)}
.native-window{gap:3px}
.native-toolbar{height:32px;grid-template-columns:minmax(0,1fr) 56px 54px;gap:3px;padding:4px 5px;border-radius:9px;background:linear-gradient(115deg,#194ea7,#1d4291);color:#fff;box-shadow:0 2px 5px #173d7a21}
.native-toolbar strong{display:flex;align-items:center;gap:5px;font-size:12.5px;line-height:24px;font-weight:800;color:#fff}
.native-toolbar strong::before{content:"";display:block;flex:none;width:24px;height:24px;border-radius:6px;background:#fff url('/icon-vetsoap-192-v20261026.png') center/cover}
.native-toolbar .button{height:23px;padding:0 3px;border:1px solid #a3bfe8;border-radius:6px;background:#ffffff24;color:#fff;font-size:10px;font-weight:700;box-shadow:none}
.native-toolbar .button:hover:enabled{background:#ffffff3d;filter:none}
.button{border:1px solid #cedbf4;border-radius:7px;background:#e2ecff;color:#1c4c9c;font-size:10.5px;font-weight:700;box-shadow:none}
.button.blue{border-color:#cedbf4;background:#e2ecff;color:#1c4c9c}
.button:disabled,.button.blue:disabled{border-color:#dce5f1;background:#e7edf7;color:#7f91aa;box-shadow:none}
.button:hover:enabled{filter:none;background:#d3e2ff}.button:active:enabled{filter:brightness(.94)}
.patient-card{height:96px;grid-template-columns:minmax(0,.42fr) minmax(0,.58fr);grid-template-rows:13px 50px 20px;gap:1px 5px;padding:4px;border:1px solid #cedbf4;border-radius:9px;background:#fff;box-shadow:0 2px 5px #173d7a0d}
.patient-card label{font-size:11px;line-height:13px;color:#1c3e72;font-weight:750}
.patient-card input{height:50px;padding:0 8px;border:1px solid #cedbf4;border-radius:8px;background:#fff;color:#1c3e72;font-size:14px;font-weight:700;box-shadow:inset 0 1px 2px #173d7a0a}
.patient-card input:focus{border:2px solid #5b8ef0;outline:0;padding-left:7px}
.mic-label{align-self:center}.patient-card .mic-label{font-size:10.5px;line-height:20px;color:#5d76a3}
#microphone{height:20px;margin-left:35px;width:calc(100% - 35px);padding:0 5px;border:1px solid #cedbf4;border-radius:6px;background:#e2ecff;color:#1c3e72;font-size:10px}
.record-card{height:80px;grid-template-columns:minmax(0,1.1fr) minmax(0,.68fr) minmax(0,1.22fr);grid-template-rows:17px 40px 11px;gap:1px 4px;padding:4px;border-radius:10px;background:linear-gradient(115deg,#194ea7,#1d4291);color:#fff;box-shadow:0 3px 7px #173d7a26}
.record-line{font-size:10.5px;line-height:17px;color:#fff;font-weight:750}
#native-timer{font-size:16px;line-height:17px;font-weight:850;color:#fff}
.dot{display:inline-block;vertical-align:1px;width:7px;height:7px;margin-right:4px;border-radius:50%;background:#d9e8ff;box-shadow:0 0 0 2px #ffffff33}
.dot.recording{background:#ff7887;box-shadow:0 0 0 3px #ff788755}.dot.paused{background:#ffd06e;box-shadow:0 0 0 3px #ffd06e55}
.record-card .button{height:40px;min-width:0;border-radius:8px;white-space:nowrap}
#start{display:flex;align-items:center;justify-content:center;border:1px solid #fff;background:#fff;color:#1c4c9c;font-size:13px;font-weight:850;box-shadow:0 2px 5px #0a2d6a26}
#start:disabled{border-color:#b9c9e3;background:#dce5f3;color:#6b80a7;box-shadow:none}
#start:hover:enabled{background:#f0f5ff}
#pause,#stop{border:1px solid #a3bfe8;background:#ffffff24;color:#fff;font-size:10.5px;font-weight:700}
#pause:disabled,#stop:disabled{border-color:#a3bfe8;background:#ffffff24;color:#dce8ff;opacity:.68}
.record-card #start-help{grid-column:1/-1;height:11px;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:9.5px;line-height:11px;color:#d5e5ff}
.record-card #start-help.recording-blocked{color:#ffe0e1}.record-card #start-help.recording-ready{color:#d5e5ff}
.audio-card{height:30px;grid-template-columns:86px minmax(0,1fr) 77px;gap:4px;padding:2px 5px;border:1px solid #cedbf4;border-radius:8px;background:#fff}
.audio-card .button{height:24px;min-width:0;padding:0 3px;border-radius:6px;font-size:10px}
#audio-path{height:23px;min-width:0;color:#1c3e72;font-size:10px}
.status-card{height:30px;grid-template-columns:25px minmax(0,1fr) 25px;grid-template-rows:21px 2px;gap:1px 4px;padding:2px 5px;border:1px solid #cedbf4;border-radius:8px;background:#fff}
.status-card label{font-size:10px;line-height:21px;font-weight:750;color:#5d76a3}
.result{height:21px;overflow:hidden;-webkit-line-clamp:2;white-space:normal;overflow-wrap:anywhere;font-size:10.5px;line-height:10.5px;color:#1c3e72}
.result.error{color:#ae3345;font-weight:750}.result.success{color:#197151;font-weight:750}.result.recovered{color:#946117;font-weight:750}
#status-detail{font-size:11px;line-height:21px;color:#1c4c9c}
#native-progress{height:2px;accent-color:#3b72d6}
.usage-card{min-height:19px;height:19px;padding:0 6px;border-radius:6px;background:#e2ecff;color:#1c3e72}
.usage-lines{font-size:10px;line-height:19px;font-weight:650}.usage-card output{font-size:10.5px}
.review-card{height:26px;padding:1px 5px 1px 7px;border-left:2px solid #5b8ef0;border-radius:4px;background:#f7faff;color:#5d76a3;font-size:9.2px;line-height:11.5px;overflow:hidden}
.pwa-status{height:13px;margin-top:0;gap:3px;color:#5d76a3;font-size:9px}
.pwa-status img{width:11px;height:11px}.pwa-status button{color:#1c4c9c;font-weight:700}
dialog{border-color:#cedbf4;background:#edf3ff;color:#1c3e72}dialog::backdrop{background:#102b5980}dialog h2{color:#1c4c9c}dialog details{border:1px solid #dfe8f8;background:#fff}dialog header button{background:#e2ecff;color:#1c4c9c}dialog input,dialog select,textarea#saved-document{border-color:#cedbf4;color:#1c3e72}
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline-color:#5b8ef0}

/* More breathing room within the existing 380x400 clinical window. */
body{padding:6px 9px 8px}
.native-toolbar{height:29px;padding:3px 9px;gap:6px}
.native-toolbar strong{line-height:23px}
.native-toolbar strong::before{width:23px;height:23px}
.native-toolbar .button{padding:0 4px}
.patient-card{height:96px;grid-template-rows:13px 50px 18px;gap:1px 10px;padding:5px 7px}
.patient-card input{padding:0 11px}
#microphone{height:18px;padding:0 8px}
.record-card{height:82px;grid-template-columns:minmax(0,1.16fr) minmax(0,.66fr) minmax(0,1.18fr);grid-template-rows:17px 40px 11px;gap:1px 11px;padding:6px 7px}
.record-card .button{padding:0 5px}
.record-card #start-help{height:11px;white-space:nowrap;display:block;line-height:11px}
.audio-card{height:30px;grid-template-columns:78px minmax(0,1fr) 69px;gap:9px;padding:2px 9px}
.status-card{height:30px;padding:2px 9px}
.usage-card{height:17px;min-height:17px;padding:0 10px}
.usage-lines{line-height:17px}
.review-card{height:26px;padding:1px 10px;line-height:11.5px}
.pwa-status{height:11px;line-height:11px;padding:0 4px}

/* Keep the approved controls usable in the 366x335 app window. */
@media(max-height:340px){
 body{padding:1px 5px}
 .application{width:min(356px,100%)}
 .native-window{gap:1px}
 .native-toolbar{height:24px;padding:1px 6px;gap:5px}
 .native-toolbar strong{line-height:22px}
 .native-toolbar strong::before{width:20px;height:20px}
 .native-toolbar .button{height:21px}
 .patient-card{height:89px;grid-template-rows:11px 50px 17px;gap:1px 7px;padding:3px 5px}
 .patient-card label{font-size:10px;line-height:11px}
 .patient-card input{height:50px}
 #microphone{height:17px}
 .record-card{height:71px;grid-template-rows:14px 40px 11px;gap:0 8px;padding:3px 5px}
 .record-line{line-height:14px}
 .record-card .button{height:40px}
 .record-card #start-help{height:11px;line-height:11px}
 .audio-card{height:27px;grid-template-columns:78px minmax(0,1fr) 69px;gap:7px;padding:1px 5px}
 .audio-card .button{height:23px}
 .status-card{height:26px;grid-template-rows:18px 2px;gap:0 4px;padding:2px 5px}
 .status-card label,#status-detail{line-height:18px}
 .result{height:18px;line-height:9px;font-size:10px}
 .usage-card{height:15px;min-height:15px;padding:0 7px}
 .usage-lines{line-height:15px}
 .review-card{height:22px;padding:1px 7px;font-size:8.7px;line-height:10px}
 .pwa-status{height:10px;line-height:10px}
}

#usage-reset{display:inline-block;vertical-align:middle;margin-left:3px;padding:2px 6px;font-size:10px;line-height:14px;height:20px}.usage-lines{white-space:nowrap}
@media(max-height:400px){#usage-reset{height:14px;line-height:12px;padding:0 5px;font-size:9px}}

/* Compact bottom controls: preserve the recording and patient controls. */
.audio-card{height:36px;grid-template-columns:70px minmax(0,1fr) 64px}
.audio-card .button{height:30px}
.usage-card{height:24px;min-height:24px}
.usage-lines{line-height:22px}
#usage-reset{height:22px;line-height:18px;padding:0 5px;font-size:9.5px}
@media(max-height:340px){
 .audio-card{height:34px;grid-template-columns:70px minmax(0,1fr) 64px}
 .audio-card .button{height:30px}
 .usage-card{height:22px;min-height:22px}
 .usage-lines{line-height:20px}
 #usage-reset{height:20px;line-height:16px;font-size:9px}
}

/* Fit the compact window while keeping its safety notice visible. */
@media(max-height:340px){
 .native-window{gap:0}
 .native-toolbar{height:22px}
 .patient-card{height:83px;grid-template-rows:11px 44px 17px}
 .patient-card input{height:44px}
 .record-card{height:69px;padding-top:2px;padding-bottom:2px}
 .status-card{height:24px}
 .usage-card{height:26px;min-height:26px}
 .usage-lines{line-height:24px}
 #usage-reset{height:24px;line-height:20px;padding:0 6px}
 .review-card{height:auto;min-height:22px;overflow:visible}
}

.record-card{position:relative}
#soap-processing:not([hidden]){position:absolute;inset:0;border-radius:10px;background:#194ea7;color:#fff;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:2px;pointer-events:none;text-align:center}
#soap-processing strong{font-size:22px;line-height:26px;font-weight:800;white-space:nowrap}
#soap-processing span{font-size:10px;line-height:13px;white-space:nowrap}

.record-card.processing-ready{grid-template-rows:22px 40px;align-content:start}
.record-card.processing-ready .record-line{visibility:hidden}
.record-card.processing-ready #start-help{display:none}
.record-card.processing-ready #soap-processing:not([hidden]){inset:1px 0 auto;height:22px;background:transparent}

.status-card.has-recovery{grid-template-columns:25px minmax(0,1fr) auto 25px}
#top-recovery{min-width:52px;min-height:22px;padding:0 7px;align-self:center;border:1px solid #a12b20;border-radius:5px;background:#a12b20;color:white;font-weight:700;cursor:pointer}
#top-recovery:disabled{opacity:.65}
#recovery-dialog[open]{display:flex;flex-direction:column;gap:5px;padding:9px;overflow:hidden}
#recovery-dialog>:not(.recovery-explanation){flex:none}
.recovery-picker{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:6px}
.recovery-actions{display:flex;gap:6px}.recovery-actions button{flex:1;min-width:0}
#recovery-times{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin:0}
#recovery-times>div{padding:4px 7px;border:1px solid #cedbf4;border-radius:7px;background:#fff}
#recovery-times dt{font-size:11px;color:#334f74}
#recovery-times dd{margin:1px 0 0;font-size:14px;font-weight:700;line-height:1.25;color:#0f294d}
.recovery-explanation{flex:1 1 auto;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 6px;background:#fff;border:1px solid #cedbf4;border-radius:7px}
.recovery-explanation:focus-visible{outline:2px solid #2563eb;outline-offset:-2px}
#recovery-summary{white-space:pre-line;margin:4px 0}
#recovery-confirmation{white-space:pre-line;background:#fff4dc;border-left:3px solid #aa580b;padding:5px 6px;margin:4px 0;color:#702d0b}
#recovery-execute{width:100%;min-height:44px;white-space:normal;border:1px solid #173b86;background:#194ea7;color:#fff;font-size:14px;font-weight:700}
#recovery-execute:disabled{border-color:#dce5f1;background:#e7edf7;color:#526583}
@media(max-height:280px){
  #recovery-dialog[open]{gap:4px;padding:6px}
  #recovery-dialog header button,#recovery-dialog .recovery-actions button,#recovery-case{min-height:26px}
  #recovery-times>div{padding-block:3px}
}
.record-card.processing-ready #soap-processing strong{font-size:19px;line-height:22px}
.record-card.processing-ready #soap-processing span{display:none}
