:root{--ink:#172b36;--ink-2:#3c5360;--muted:#72818a;--teal:#096e70;--teal-2:#0d8587;--bg:#f7f9f9;--line:#e4e9eb;--white:#fff;--bluewash:#eaf4f3;--red:#9a3d3d;--shadow:0 9px 30px rgba(17,45,49,.035)}
*{box-sizing:border-box}html{font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);background:var(--bg);font-size:15px}body{margin:0;min-height:100vh;display:flex;flex-direction:column}a{text-decoration:none;color:inherit}button,input{font:inherit}button{cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}input{border-radius:8px;border:1px solid #d8e0e2;padding:13px 14px;width:100%;background:#fff;color:var(--ink);transition:border-color .15s}input:focus{outline:3px solid #d6eded;border-color:var(--teal)}label{display:block;font-size:.87rem;font-weight:650;margin-bottom:-6px}.shell{width:min(1150px,calc(100% - 64px));margin-inline:auto}.topbar{background:#fff;border-bottom:1px solid var(--line)}.topbar-inner{height:80px;display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{display:flex;align-items:center;font-size:1.3rem;letter-spacing:-.045em;font-weight:760}.brand-symbol{display:grid;place-items:center;font-size:1.5rem;color:var(--teal);background:#e7f4f1;width:37px;height:37px;border-radius:11px;margin-right:12px}.brand-dot,.accent{color:var(--teal)}.topnav{display:flex;align-items:center;gap:24px}.topnav form{display:inline}.nav-button,.nav-link{color:var(--ink-2);font-size:.85rem;border:0;background:transparent;font-weight:650;cursor:pointer}.nav-link:hover,.nav-button:hover{color:var(--teal)}.demo-banner{background:#fff8ed;border-bottom:1px solid #f3e7ce;color:#8d6b28;text-align:center;padding:9px 16px;font-size:.76rem;font-weight:650}.demo-dot{display:inline-block;background:#c79641;width:7px;height:7px;border-radius:99px;margin-right:7px}.main-area{flex:1;padding-top:53px;padding-bottom:80px}.footer{border-top:1px solid var(--line);color:#8b979d;padding:23px 0 30px;display:flex;justify-content:space-between;font-size:.78rem;gap:20px}.eyebrow,.overline{font-size:.72rem;font-weight:760;letter-spacing:.14em;color:var(--teal);margin-bottom:17px}.overline{margin-bottom:13px}h1{font-size:clamp(2.3rem,4.1vw,3.6rem);letter-spacing:-.058em;line-height:1.08;font-weight:720;margin:0 0 14px}h2{font-size:1.2rem;letter-spacing:-.035em;line-height:1.25;margin:0}h3{font-size:1rem;margin:0 0 8px}.lead{font-size:1.08rem;line-height:1.75;color:var(--ink-2)}.subhead{font-size:1rem;color:var(--muted);line-height:1.6;margin:0}.muted{color:var(--muted)}.small{font-size:.86rem}.micro{font-size:.77rem}.caption{font-size:.83rem}.panel{border:1px solid var(--line);background:var(--white);box-shadow:var(--shadow);border-radius:15px;padding:30px}.page-heading{margin-bottom:34px}.row-between,.between{display:flex;align-items:center;justify-content:space-between;gap:20px}.button{appearance:none;display:inline-flex;align-items:center;justify-content:center;gap:13px;padding:12px 18px;border:1px solid transparent;border-radius:9px;font-weight:700;font-size:.86rem;transition:background-color .18s,color .18s;white-space:nowrap;cursor:pointer}.button.primary{color:white;background:var(--teal)}.button.primary:hover:not(:disabled){background:#075759}.button.subtle{background:#f0f5f5;color:#226568;border-color:#e2eeee}.button.subtle:hover{background:#e4eeee}.button.ghost{background:#fff;color:var(--ink-2);border-color:var(--line)}.button.danger{color:var(--red)}.button.full{width:100%;margin-top:5px}.stack{display:flex;flex-direction:column}.gap-md{gap:13px}.stats-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:20px}.stat{padding:24px 27px}.stat-label{color:var(--muted);font-size:.83rem;font-weight:600}.stat-number{font-size:2.4rem;line-height:1.1;letter-spacing:-.05em;font-weight:720;margin:13px 0 9px}.stat-note{font-size:.76rem;color:var(--muted)}.dashboard-grid{display:grid;grid-template-columns:360px minmax(0,1fr);gap:20px;align-items:stretch}.heading-row{display:flex;align-items:center;gap:12px;margin-bottom:20px}.heading-row.between{justify-content:space-between}.mini-icon{background:#eaf4f3;color:var(--teal);display:grid;place-items:center;width:35px;height:35px;border-radius:10px;font-size:1.2rem;font-weight:bold}.create-panel>p{font-size:.9rem;line-height:1.65;margin:0 0 26px}.create-panel label{font-size:.85rem}.field-help{color:var(--muted);font-size:.77rem;margin:0;line-height:1.55}.mini-divider{height:1px;background:var(--line);margin:25px 0 20px}.info-line{display:flex;align-items:center;gap:11px;font-size:.83rem;color:var(--ink-2);margin:12px 0}.check-icon{font-weight:700;color:var(--teal)}.cases-panel{min-height:375px}.case-list{margin:-7px -13px}.case-row{display:flex;gap:14px;align-items:center;padding:17px 13px;border-top:1px solid #eef1f2}.case-row:first-child{border-top:0}.case-row:hover{background:#f9fbfb;border-radius:8px}.case-avatar{display:grid;place-items:center;background:#ecf2f3;border-radius:10px;color:#67838a;width:41px;height:41px;font-size:1.3rem;flex-shrink:0}.case-info{display:flex;flex-direction:column;gap:6px;min-width:0;flex:1}.case-info strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:.91rem}.tag{display:inline-block;padding:7px 10px;white-space:nowrap;border-radius:99px;font-size:.72rem;font-weight:710}.tag.success{color:#147754;background:#e4f5ed}.tag.waiting{color:#896726;background:#fff6e6}.tag.failed{color:#a33c40;background:#fcebec}.tag.neutral{color:#67757a;background:#f0f2f2}.row-chevron{color:#a6b4b6}.empty-state{padding:35px 12px 24px;text-align:center;display:flex;flex-direction:column;align-items:center;color:var(--muted)}.empty-state p{font-size:.85rem;margin:0}.empty-state h3{color:var(--ink)}.empty-icon{font-size:2rem;color:#b7caca;margin-bottom:17px}.breadcrumb{display:inline-block;font-size:.82rem;color:var(--teal);font-weight:650;margin-bottom:27px}.case-grid{margin-bottom:20px}.case-grid>.panel{min-height:255px}.case-grid p.muted{line-height:1.65}.button-row{display:flex;flex-wrap:wrap;gap:9px;margin-top:20px}.copy-group{display:flex;gap:8px;margin:11px 0}.copy-group input{flex:1;min-width:0;font-size:.81rem}.files-panel{padding:30px}.data-table{border-collapse:collapse;width:100%;font-size:.87rem;text-align:left}.data-table th{color:var(--muted);font-weight:680;font-size:.77rem;padding:15px 10px;border-bottom:1px solid var(--line)}.data-table td{padding:19px 10px;border-bottom:1px solid #edf1f1;vertical-align:middle}.data-table tr:last-child td{border-bottom:0}.data-table td .micro{margin-top:5px}.data-table td:first-child{max-width:300px;overflow-wrap:anywhere}.viewer-link{display:inline-block;font-weight:680;color:var(--teal);white-space:nowrap;margin:3px 8px 3px 0}.viewer-link:hover{text-decoration:underline}.error-note{font-size:.74rem;color:var(--red);max-width:280px;margin-top:7px;overflow-wrap:anywhere}.alert{padding:12px 15px;background:#f2f6f6;color:#506a6f;border-radius:9px;margin:15px 0;font-size:.86rem;line-height:1.6}.alert.success-alert{background:#ebf7ef;color:#2d6844}.alert.error{background:#fff0f0;color:#953b40}.login-layout{display:grid;grid-template-columns:1fr 430px;gap:70px;align-items:center;min-height:550px}.intro-panel{padding:10px 0}.intro-panel h1{max-width:470px;font-size:4.5rem}.intro-panel .lead{max-width:440px}.intro-rule{width:65px;height:3px;background:var(--teal);margin:32px 0}.aside-copy{color:#8ba0a4;font-size:.88rem;max-width:350px;line-height:1.7}.login-card{padding:43px}.login-card h2{font-size:1.75rem}.login-card p.small{margin-top:9px;margin-bottom:27px}.login-card .micro{margin-top:20px;line-height:1.6}.upload-layout{max-width:810px;margin:0 auto}.upload-head{margin-bottom:32px}.upload-head h1{margin-bottom:16px}.upload-head .lead{max-width:700px;margin-bottom:24px}.context-chip{display:inline-flex;align-items:center;gap:6px;border:1px solid #e0ebea;border-radius:99px;background:#f0f7f6;font-size:.85rem;color:var(--ink-2);padding:9px 14px}.chip-dot{width:7px;height:7px;background:var(--teal);border-radius:50%;margin-right:5px}.upload-panel{padding:34px}.drop-zone{border:2px dashed #bfd1d2;background:#fbfdfd;padding:39px 25px;border-radius:13px;text-align:center;transition:background-color .2s,border .2s;cursor:pointer}.drop-zone.dragging,.drop-zone:focus{background:#edf8f6;border-color:var(--teal);outline:0}.drop-circle{display:grid;place-items:center;width:54px;height:54px;border-radius:50%;background:#e2f1ef;color:var(--teal);margin:0 auto 18px;font-size:2rem}.drop-zone h2{font-size:1.15rem;margin-bottom:8px}.drop-zone p{font-size:.85rem;color:var(--muted);margin:0 0 22px}.file-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}.upload-select{pointer-events:auto}.upload-options,.submit-row{display:flex;justify-content:space-between;gap:16px;align-items:center;padding-top:17px}.submit-row{border-top:1px solid var(--line);margin-top:22px}.selected-files{margin-top:19px}.selected-file{display:flex;gap:12px;align-items:center;padding:14px 0;border-bottom:1px solid #eef1f2}.file-icon{background:#eff4f5;color:var(--teal);padding:12px;border-radius:9px}.file-info{min-width:0;flex:1}.file-name{font-weight:680;overflow-wrap:anywhere;font-size:.89rem}.file-sub{color:var(--muted);font-size:.77rem;margin-top:4px}.file-status{min-width:80px;text-align:right;font-size:.79rem;color:var(--teal);font-weight:700}.progress{width:100%;height:5px;background:#e9eded;border-radius:20px;overflow:hidden;margin-top:9px}.progress-fill{height:100%;background:var(--teal);width:0;transition:width .15s}.upload-assistance{display:flex;gap:15px;margin-top:24px;background:#eef5f4;border:1px solid #e2ebea;border-radius:12px;padding:20px 23px}.assist-icon{color:var(--teal);font-size:1.3rem}.upload-assistance strong{font-size:.89rem}.upload-assistance p{color:#61757d;font-size:.83rem;line-height:1.6;margin:6px 0 0}.upload-footer-note{margin-top:25px;text-align:center}.nav-secure{font-weight:650;color:var(--teal);font-size:.84rem}
@media(max-width:900px){.dashboard-grid{grid-template-columns:1fr}.login-layout{grid-template-columns:1fr;gap:25px}.intro-panel h1{font-size:3.5rem}.login-card{max-width:550px}.stats-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.page-heading.row-between{align-items:flex-start;flex-direction:column}.case-row{flex-wrap:wrap}.tag{font-size:.68rem}}
@media(max-width:600px){.shell{width:calc(100% - 34px)}.topbar-inner{height:69px}.main-area{padding-top:34px;padding-bottom:45px}.hide-small{display:none}.panel{padding:22px}.stats-grid{grid-template-columns:1fr;gap:10px}.stat{padding:18px 21px}.stat-number{font-size:2rem}.footer{flex-direction:column}.login-card{padding:27px}.intro-panel h1{font-size:3.1rem}.upload-panel{padding:19px}.upload-options{flex-direction:column;align-items:flex-start;gap:4px}.submit-row{flex-direction:column;align-items:stretch}.submit-row .button{width:100%}.upload-table-wrap{overflow-x:auto}.data-table{min-width:630px}.copy-group{flex-direction:column}.case-info{min-width:160px}.context-chip{line-height:1.5}}

@media(max-width:600px){.file-actions{flex-direction:column}.file-actions .button{width:100%}}

.study-panel{margin-bottom:20px}.study-list{display:flex;flex-direction:column;gap:12px}.study-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:14px 0;border-top:1px solid var(--line);overflow-wrap:anywhere}.study-row strong{font-size:.84rem}.study-row .small{margin-top:7px}.study-row .button{flex-shrink:0}@media(max-width:600px){.study-row{flex-direction:column;align-items:flex-start}}

/* v0.3: patient-centric workspace and explicit empty-record deletion */
.legacy-cases{margin-top:20px}.legacy-cases>p{margin:0 0 18px;line-height:1.55}.legacy-create{margin-top:24px;padding-top:18px;border-top:1px solid var(--line)}
.legacy-create summary{color:var(--teal);font-size:.87rem;font-weight:700;cursor:pointer}
.inline-create{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-top:12px}
.inline-create label{font-size:.83rem;font-weight:650;min-width:90px}
.inline-create input,.inline-create select{min-width:190px;max-width:420px;flex:1}
.patient-grid{margin-bottom:20px}.patient-study-row .study-desc{min-width:0;overflow-wrap:anywhere}
.patient-study-row .study-desc>strong{font-size:.98rem}
.patient-delete-panel,.empty-case-delete,.patient-assign-panel{margin:20px 0}
.patient-delete-panel>p,.empty-case-delete>p,.patient-assign-panel>p{line-height:1.6;margin-top:10px}
.patient-delete-panel input,.empty-case-delete input{flex:0 1 210px}
@media(max-width:600px){.inline-create{align-items:stretch;flex-direction:column}.inline-create input,.inline-create select,.inline-create button{max-width:none;width:100%}}

.inline-create select{font:inherit;border-radius:8px;border:1px solid #d8e0e2;padding:13px 14px;background:#fff;color:var(--ink)}
.inline-create select:focus{outline:3px solid #d6eded;border-color:var(--teal)}

/* v0.4: explicit safeguards around destructive data-management actions */
.danger-panel{margin:20px 0;border:1px solid #edd5d5;background:#fffefe}
.danger-panel h2{margin-bottom:12px}.danger-panel h3{font-size:1rem;margin:0 0 9px}
.danger-panel>p{line-height:1.6}.danger-actions{margin:12px 0 5px;max-width:100%}
.danger-actions>summary{font-size:.84rem;color:#9e4d4d;cursor:pointer;font-weight:680;padding:9px 0}
.delete-confirm-form{display:flex;flex-wrap:wrap;gap:9px;align-items:end;margin:13px 0 9px}
.delete-confirm-form label{font-size:.81rem;display:block;flex-basis:100%}
.delete-confirm-form input[type=text]{flex:1;min-width:170px;max-width:380px}
.danger-grid{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin-top:20px}
.danger-grid>div{padding-top:16px;border-top:1px solid #f0dfdf}
.study-actions{display:flex;flex-wrap:wrap;gap:11px;align-items:center;justify-content:flex-end}
.study-actions .danger-actions{flex-basis:100%;max-width:400px}
@media(max-width:800px){.danger-grid{grid-template-columns:1fr}.study-actions{justify-content:flex-start}}
@media(max-width:600px){.delete-confirm-form{flex-direction:column;align-items:stretch}.delete-confirm-form input[type=text]{max-width:none}}
