@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@400;500;600;700&display=swap');
:root{--bg:#f5f7fb;--surface:rgba(255,255,255,.92);--surface2:#fff;--text:#18212f;--muted:#6d7685;--line:#e2e7ef;--blue:#1f66b2;--blue2:#174f8b;--accent:#8baad0;--danger:#c93838;--radius:18px;--shadow:0 16px 45px rgba(35,52,73,.08),0 2px 6px rgba(35,52,73,.04)}
*{box-sizing:border-box}html{background:var(--bg)}body{margin:0;background:radial-gradient(circle at 15% 0,rgba(31,102,178,.06),transparent 30%),var(--bg);color:var(--text);font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}a{color:inherit;text-decoration:none}.topbar{max-width:1440px;margin:auto;padding:12px 28px;display:flex;align-items:center;justify-content:space-between;gap:20px}.brand{display:flex;align-items:center;gap:11px}.brand-mark{display:grid;place-items:center;width:36px;height:36px;border-radius:12px;background:linear-gradient(135deg,#266fbf,#174f8b);color:#fff;box-shadow:0 5px 14px rgba(31,102,178,.24)}.brand strong{display:block;font-size:15px}.brand small{display:block;color:var(--muted);font-size:10px;letter-spacing:.08em;text-transform:uppercase;margin-top:1px}header{position:sticky;top:0;z-index:50;background:rgba(255,255,255,.82);border-bottom:1px solid rgba(226,231,239,.85);backdrop-filter:blur(20px) saturate(180%);-webkit-backdrop-filter:blur(20px) saturate(180%)}nav{display:flex;align-items:center;gap:5px}nav>a,.nav-button{padding:9px 11px;border-radius:10px;color:#435064;font-size:13px;font-weight:600;border:0;background:transparent;cursor:pointer}nav>a:hover,.nav-button:hover{background:#edf3fa;color:#174f8b}.logout-form{margin:0}.page{max-width:1320px;margin:0 auto;padding:42px 26px 70px}.page.narrow{max-width:980px}.page-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:20px;margin-bottom:28px}.eyebrow{margin:0 0 7px;color:#718096;font-size:11px;font-weight:700;letter-spacing:.12em;text-transform:uppercase}h1{font-size:36px;line-height:1.08;margin:0;letter-spacing:-.04em}h2{font-size:21px;letter-spacing:-.025em;margin:0 0 16px}h3{letter-spacing:-.02em}.muted{color:var(--muted)}.surface{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.button,button{font:inherit}.button,.primary{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:9px 15px;border:0;border-radius:999px;background:var(--blue);color:#fff;font-weight:700;font-size:13px;cursor:pointer}.button:hover,.primary:hover{background:var(--blue2)}.button.ghost{background:#fff;color:#425068;border:1px solid var(--line)}.button.small{min-height:34px;padding:7px 12px}.pet-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(255px,1fr));gap:18px}.pet-card{display:flex;gap:16px;align-items:center;padding:18px;border-radius:20px;background:#fff;border:1px solid var(--line);box-shadow:var(--shadow);transition:.18s ease}.pet-card:hover{transform:translateY(-2px);box-shadow:0 18px 48px rgba(35,52,73,.12)}.pet-avatar{width:78px;height:78px;flex:0 0 78px;border-radius:18px;overflow:hidden;display:grid;place-items:center;background:linear-gradient(145deg,#eef4fb,#dde8f5);font-size:34px}.pet-avatar img{width:100%;height:100%;object-fit:cover}.pet-card-title{display:flex;align-items:center;gap:8px}.pet-card h2{margin:0;font-size:20px}.pet-card p{margin:4px 0;color:var(--muted);font-size:13px}.meta-line{display:flex;gap:10px;color:#87909d;font-size:11px}.memorial-card{background:linear-gradient(145deg,#fffefa,#f7f3eb);border-color:#e2d8c6}.memorial-cross{color:#8f7d60}.memorial-line{font-family:"DM Serif Display",Georgia,serif;color:#7c6b52;font-size:12px;margin-top:5px}.profile-hero{position:relative;overflow:hidden;display:grid;grid-template-columns:150px 1fr;gap:28px;align-items:center;padding:26px;margin-bottom:20px;background:linear-gradient(135deg,#fff,#f6faff);border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow)}.hero-photo{width:150px;height:150px;border-radius:22px;overflow:hidden;background:linear-gradient(145deg,#eef4fb,#dce8f5);display:grid;place-items:center;font-size:58px}.hero-photo img{width:100%;height:100%;object-fit:cover}.hero-copy h1{font-size:44px}.hero-sub{font-size:16px;color:var(--muted);margin:8px 0 14px}.hero-chips{display:flex;gap:8px;flex-wrap:wrap}.hero-chips span{padding:5px 9px;border-radius:999px;background:#eef3f9;color:#556278;font-size:11px;font-weight:600}.hero-watermark{position:absolute;right:30px;top:15px;font-family:Georgia,serif;font-size:82px;color:rgba(115,96,67,.12)}.memorial-hero{background:radial-gradient(circle at 88% 20%,rgba(164,142,105,.13),transparent 28%),linear-gradient(145deg,#fffefa,#f3eee4);border-color:#ded3c0}.memorial-hero .hero-photo{filter:saturate(.75);border:5px solid #fff}.in-memoriam{font-family:"DM Serif Display",Georgia,serif;color:#76664e}.overview-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-bottom:34px}.info-card{padding:20px}.info-card dl,.facility-card dl{margin:0}.info-card dl>div,.facility-card dl>div{display:flex;justify-content:space-between;gap:18px;padding:8px 0;border-bottom:1px solid #edf0f4}.info-card dl>div:last-child,.facility-card dl>div:last-child{border-bottom:0}dt{color:var(--muted);font-size:12px}dd{margin:0;text-align:right;font-size:12px;font-weight:600}.record-section{margin-top:34px}.section-title{display:flex;align-items:end;justify-content:space-between;margin-bottom:12px}.section-title h2{margin:0}.table-shell{overflow:auto}table{width:100%;border-collapse:collapse}th{padding:12px 15px;text-align:left;color:#7a8492;font-size:10px;letter-spacing:.08em;text-transform:uppercase;background:#f8fafc}td{padding:14px 15px;border-top:1px solid #edf0f4;font-size:13px}.empty{text-align:center;color:var(--muted);padding:28px}.timeline{display:grid;gap:12px}.visit-card{padding:18px;display:grid;grid-template-columns:58px 1fr;gap:17px}.visit-date{width:58px;height:58px;border-radius:14px;background:#eef4fb;display:grid;place-items:center;align-content:center;color:#1d5c9e}.visit-date strong{font-size:10px;text-transform:uppercase}.visit-date span{font-size:23px;font-weight:700}.visit-card h3{margin:3px 0 4px}.form-surface{padding:26px}.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:0 16px}.stack-form{display:grid;gap:13px}label{display:block;color:#465268;font-size:12px;font-weight:600;margin-bottom:13px}input,select,textarea{width:100%;margin-top:6px;padding:10px 12px;min-height:42px;border:1px solid #d5dce5;border-radius:11px;background:#fff;color:var(--text);font:inherit;outline:none}textarea{min-height:100px;resize:vertical}input:focus,select:focus,textarea:focus{border-color:#70a3da;box-shadow:0 0 0 4px rgba(31,102,178,.11)}.switch-line{display:flex;align-items:center;gap:10px}.switch-line input{width:auto;min-height:auto;margin:0}.form-actions{display:flex;justify-content:flex-end;margin-top:20px}.vet-preview{grid-template-columns:repeat(2,1fr);gap:8px;margin:12px 0 20px}.vet-preview:not([hidden]){display:grid}.vet-preview div{padding:11px 13px;border-radius:12px;background:#f7f9fc;border:1px solid #e6ebf2}.vet-preview span{display:block;color:#7c8796;font-size:10px;text-transform:uppercase;letter-spacing:.07em}.vet-preview strong{font-size:12px}.split-layout{display:grid;grid-template-columns:380px 1fr;gap:20px}.facility-list{display:grid;gap:14px}.facility-card{padding:20px}.doctor{color:#1f66b2;font-weight:600}.modal[hidden]{display:none}.modal{position:fixed;inset:0;z-index:100;display:grid;place-items:center;padding:20px}.modal-backdrop{position:absolute;inset:0;background:rgba(19,29,42,.45);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px)}.modal-card{position:relative;z-index:1;width:min(650px,100%);max-height:90vh;overflow:auto;padding:25px;border-radius:24px;background:rgba(255,255,255,.97);border:1px solid rgba(255,255,255,.8);box-shadow:0 28px 90px rgba(0,0,0,.24)}.modal-x{position:absolute;right:15px;top:15px;width:34px;height:34px;border:0;border-radius:50%;background:#eef1f5;color:#4b5564;font-size:20px;cursor:pointer}.theme-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.theme-tile{text-align:left;padding:14px;border:1px solid var(--line);border-radius:15px;background:#fff;color:var(--text);cursor:pointer}.theme-tile strong,.theme-tile small{display:block}.theme-tile small{color:var(--muted);margin-top:3px}.theme-swatch{display:block;height:54px;margin-bottom:10px;border-radius:10px}.theme-swatch.classic{background:linear-gradient(135deg,#f7f9fc 50%,#1f66b2 50%)}.theme-swatch.emr{background:linear-gradient(135deg,#edf5f4 50%,#26716c 50%)}.theme-swatch.glass{background:linear-gradient(135deg,#d8e8ff,#c7d1ff 45%,#f6dcec)}.theme-swatch.midnight{background:linear-gradient(135deg,#161b24 50%,#315f9a 50%)}footer{max-width:1320px;margin:0 auto;padding:22px 26px 38px;color:#8b94a1;font-size:11px;text-align:center}footer span{margin:0 3px}.login-page{min-height:100vh;background:#eef3f8}.login-shell{min-height:100vh;display:grid;grid-template-columns:1.15fr .85fr}.login-art{position:relative;overflow:hidden;padding:10vh 9vw;background:radial-gradient(circle at 20% 20%,rgba(255,255,255,.15),transparent 28%),linear-gradient(145deg,#123c6a,#1d68b5 70%,#6194cb);color:#fff}.login-art:after{content:"";position:absolute;width:460px;height:460px;border:1px solid rgba(255,255,255,.12);border-radius:50%;right:-120px;bottom:-160px;box-shadow:0 0 0 80px rgba(255,255,255,.035),0 0 0 160px rgba(255,255,255,.025)}.login-emblem{font-size:42px}.login-art .eyebrow{color:rgba(255,255,255,.7);margin-top:45px}.login-art h1{font-family:"DM Serif Display",Georgia,serif;font-size:64px;font-weight:400;letter-spacing:-.03em}.login-copy{max-width:540px;font-size:17px;line-height:1.7;color:rgba(255,255,255,.78)}.login-card{display:flex;flex-direction:column;justify-content:center;padding:10vh 9vw;background:#fff}.login-card h2{font-size:34px}.wide{width:100%}.powered{text-align:center;color:#939ba6;font-size:11px;margin-top:25px}.alert{padding:11px 13px;border-radius:11px;margin:12px 0;font-size:12px}.alert.error{background:#fff0f0;color:#a82f2f}.alert.success{background:#eef9f0;color:#32733f}

/* Themes */
body[data-theme="emr"]{--bg:#eef4f3;--surface:#fff;--text:#1c302f;--muted:#657a78;--line:#dce8e6;--blue:#26716c;--blue2:#1e5955}
body[data-theme="glass"]{--bg:#eaf0fb;--surface:rgba(255,255,255,.63);--line:rgba(255,255,255,.7);--blue:#526bd5;--blue2:#4054ae;background:radial-gradient(circle at 10% 10%,#dcecff,transparent 32%),radial-gradient(circle at 90% 25%,#f7e0ef,transparent 30%),#eaf0fb}body[data-theme="glass"] .surface,body[data-theme="glass"] .pet-card{backdrop-filter:blur(24px);-webkit-backdrop-filter:blur(24px)}
body[data-theme="midnight"]{--bg:#111722;--surface:#18202d;--surface2:#18202d;--text:#edf3fb;--muted:#8e9bad;--line:#273245;--blue:#4c8bd4;--blue2:#67a2e5;background:#111722}body[data-theme="midnight"] header{background:rgba(17,23,34,.88);border-color:#273245}body[data-theme="midnight"] .pet-card,body[data-theme="midnight"] input,body[data-theme="midnight"] select,body[data-theme="midnight"] textarea,body[data-theme="midnight"] .theme-tile{background:#18202d;color:#edf3fb;border-color:#303b4d}body[data-theme="midnight"] th{background:#131b27}body[data-theme="midnight"] td{border-color:#273245}body[data-theme="midnight"] .hero-chips span,body[data-theme="midnight"] .visit-date{background:#26364b}

@media(max-width:850px){.topbar{padding:10px 14px}.brand small{display:none}nav>a{display:none}.page{padding:26px 14px 55px}.page-heading{align-items:center}h1{font-size:30px}.pet-grid{grid-template-columns:1fr}.profile-hero{grid-template-columns:95px 1fr;padding:18px}.hero-photo{width:95px;height:95px}.hero-copy h1{font-size:32px}.overview-grid{grid-template-columns:1fr}.form-grid,.split-layout,.theme-grid{grid-template-columns:1fr}.login-shell{grid-template-columns:1fr}.login-art{display:none}.login-card{padding:10vh 8vw}.table-shell{overflow-x:auto}}

/* 1.1.0 native record accordion and full-profile additions */
.hero-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-left:auto;z-index:2}.photo-menu{position:relative}.photo-menu>summary{list-style:none}.photo-menu>summary::-webkit-details-marker{display:none}.photo-menu[open]{min-width:260px}.photo-menu form{padding:10px 0;display:grid;gap:8px}.admin-box{margin:18px 0;padding:18px;border:1px solid #e5d7c1;border-radius:14px;background:#fcf9f4}.danger{display:inline-flex;align-items:center;justify-content:center;min-height:36px;padding:8px 13px;border:0;border-radius:999px;background:#c83b3b;color:#fff;font-weight:700;cursor:pointer}.danger:hover{background:#a92f2f}.record-accordion{margin:18px 0;border:1px solid var(--line);border-radius:20px;background:var(--surface);box-shadow:var(--shadow);overflow:hidden}.record-accordion>summary{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:17px 20px;cursor:pointer;list-style:none;background:linear-gradient(180deg,rgba(255,255,255,.55),rgba(248,250,253,.45))}.record-accordion>summary::-webkit-details-marker{display:none}.record-accordion>summary span:first-child{display:grid;gap:3px}.record-accordion>summary small{font-size:10px;letter-spacing:.11em;color:var(--muted)}.record-accordion>summary strong{font-size:19px}.summary-meta{font-size:11px;color:var(--muted);padding:5px 9px;border-radius:999px;background:rgba(127,145,167,.1)}.accordion-body{padding:16px 18px 20px;border-top:1px solid var(--line)}.add-panel>details{border:1px dashed #cad5e2;border-radius:14px;margin-bottom:14px;background:rgba(247,250,253,.65)}.add-panel>details>summary,.record-editor>summary,.inline-editor>summary{cursor:pointer;padding:10px 12px;font-size:12px;font-weight:700;color:var(--blue)}.add-panel form,.record-editor form,.inline-editor form{padding:12px}.record-list{display:grid;gap:9px}.record-item{border:1px solid var(--line);border-radius:14px;background:var(--surface2);overflow:hidden}.record-item>summary{display:flex;align-items:center;justify-content:space-between;gap:14px;cursor:pointer;padding:13px 15px;list-style:none}.record-item>summary::-webkit-details-marker{display:none}.record-item>summary span:first-child{display:grid;gap:3px}.record-item>summary small{color:var(--muted);font-size:11px}.date-chip{font-size:11px;color:var(--blue);background:rgba(31,102,178,.08);padding:5px 8px;border-radius:999px}.record-detail{padding:14px 15px;border-top:1px solid var(--line)}.detail-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin-bottom:12px}.detail-grid>div{padding:10px;border-radius:11px;background:rgba(127,145,167,.07)}.detail-grid span{display:block;color:var(--muted);font-size:9px;text-transform:uppercase;letter-spacing:.07em}.detail-grid strong{display:block;margin-top:3px;font-size:12px}.record-editor{margin-top:12px;border:1px solid var(--line);border-radius:12px}.inline-editor{min-width:180px}.text-link{color:var(--blue);font-weight:700}.record-photo{display:block;max-width:260px;max-height:240px;border-radius:14px;object-fit:cover;margin-bottom:12px}.photo-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:14px}.age-card{overflow:hidden}.age-card>img{display:block;width:100%;height:190px;object-fit:cover}.age-card>div{padding:13px}.age-card strong,.age-card small{display:block}.age-card small{margin-top:3px;color:var(--muted);font-size:10px}.split{justify-content:space-between}
body[data-theme="midnight"] .record-accordion>summary,body[data-theme="midnight"] .add-panel>details{background:#18202d}.memorial-page .record-accordion{border-color:#dfd5c5}.memorial-page .record-accordion>summary{background:linear-gradient(180deg,#fffdf8,#f7f2e8)}.memorial-page .date-chip{background:#eee6d8;color:#78664b}
@media(max-width:850px){.profile-hero{grid-template-columns:90px 1fr}.hero-actions{grid-column:1/-1;margin-left:0}.detail-grid{grid-template-columns:1fr}.record-item>summary{align-items:flex-start}.accordion-body{padding:12px}.photo-grid{grid-template-columns:1fr 1fr}}
@media(max-width:520px){.photo-grid{grid-template-columns:1fr}.record-accordion>summary{padding:14px}.summary-meta{display:none}}
.error-shell{max-width:620px;margin:12vh auto;padding:35px}.error-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;color:var(--muted)}

.status-good{background:rgba(220,252,231,.82)!important;border-color:#86efac!important}.status-good>summary{color:#166534}.status-warning{background:rgba(254,249,195,.86)!important;border-color:#fde047!important}.status-warning>summary{color:#854d0e}.status-danger{background:rgba(254,226,226,.9)!important;border-color:#fca5a5!important}.status-danger>summary{color:#b91c1c}.refill-history{margin:1rem 0;padding:1rem;border-radius:14px;background:rgba(255,255,255,.45)}.refill-row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:.5rem;padding:.35rem 0;border-bottom:1px solid rgba(148,163,184,.2);font-size:.85rem}.refill-form{display:flex;flex-wrap:wrap;align-items:end;gap:.6rem;margin:1rem 0}.qr{width:260px;max-width:100%;border-radius:16px;background:white;padding:10px}.recovery-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.6rem;margin:1rem 0}.recovery-grid code{padding:.7rem;border-radius:10px;background:rgba(255,255,255,.65);text-align:center}.pdf-preview{width:100%;height:650px;border:1px solid rgba(148,163,184,.3);border-radius:16px;background:white}.pdf-actions{display:flex;gap:.6rem;flex-wrap:wrap}.document-choice{display:flex;gap:.7rem;align-items:flex-start;padding:.6rem;border-radius:12px;background:rgba(255,255,255,.4)}.document-choice span{display:flex;flex-direction:column}.paw-mark{text-align:center;font-size:2rem}.login-shell.single{grid-template-columns:minmax(320px,520px);justify-content:center}.hero-actions{display:flex;gap:.5rem;flex-wrap:wrap}


/* 1.3.0 refinements */
.brand-paw{font-size:19px;line-height:1;filter:drop-shadow(0 1px 1px rgba(0,0,0,.2))}
body[data-theme="glass"] .brand-mark{background:linear-gradient(145deg,rgba(255,255,255,.78),rgba(145,179,255,.58));border:1px solid rgba(255,255,255,.9);box-shadow:0 8px 22px rgba(67,86,166,.18),inset 0 1px 0 rgba(255,255,255,.9);color:#203d83}
body[data-theme="glass"] .brand-paw{filter:drop-shadow(0 1px 0 rgba(255,255,255,.95));font-size:20px}
.theme-swatch.sunos{background:linear-gradient(180deg,#d6d3c7 0 25%,#8c9b88 25% 48%,#c8c4b7 48% 74%,#54695e 74%)}
body[data-theme="sunos"]{--bg:#b8b5a8;--surface:#d8d5c9;--surface2:#d2cfc3;--text:#151515;--muted:#4d514d;--line:#807e75;--blue:#49685d;--blue2:#344c44;--radius:2px;--shadow:2px 2px 0 #66645d,-1px -1px 0 #f4f1e5;background:#b8b5a8;font-family:"Nimbus Sans",Helvetica,Arial,sans-serif}
body[data-theme="sunos"] header{background:#c9c6ba;border-bottom:2px solid #6d6b64;backdrop-filter:none;-webkit-backdrop-filter:none}
body[data-theme="sunos"] .surface,body[data-theme="sunos"] .pet-card,body[data-theme="sunos"] .record-item,body[data-theme="sunos"] .record-accordion,body[data-theme="sunos"] .theme-tile{border-radius:2px;background:#d8d5c9;border:1px solid #77756d;box-shadow:inset 1px 1px 0 #f4f1e5,inset -1px -1px 0 #8e8b82,2px 2px 0 #68665f}
body[data-theme="sunos"] .button,body[data-theme="sunos"] button,body[data-theme="sunos"] input,body[data-theme="sunos"] select,body[data-theme="sunos"] textarea{border-radius:1px}
body[data-theme="sunos"] input,body[data-theme="sunos"] select,body[data-theme="sunos"] textarea{background:#ece9dc;border:1px inset #918f86;color:#111}
body[data-theme="sunos"] .record-accordion>summary{background:#c8c5b8}
body[data-theme="sunos"] .brand-mark{border-radius:2px;background:#5f786e;color:#fff;box-shadow:inset 1px 1px 0 #aab7b0,inset -1px -1px 0 #344b42}
.attention-badge{display:inline-flex;align-items:center;padding:4px 7px;border-radius:999px;background:var(--danger);color:#fff;font-size:9px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;box-shadow:0 3px 10px rgba(201,56,56,.22)}
body[data-theme="glass"] .attention-badge{background:rgba(196,43,58,.82);border:1px solid rgba(255,255,255,.72);backdrop-filter:blur(10px)}
body[data-theme="midnight"] .attention-badge{background:#e15d68;color:#fff}
body[data-theme="sunos"] .attention-badge{border-radius:1px;background:#8b2323;box-shadow:inset 1px 1px #c97979,inset -1px -1px #541313}
.med-summary-status{display:flex!important;grid-auto-flow:column;gap:6px!important;align-items:center}.days-chip{white-space:nowrap}
.refill-row{grid-template-columns:1.2fr .8fr .9fr 1.1fr auto;align-items:center}.refill-row small{display:block;color:var(--muted);font-size:10px;margin-top:2px}.refill-user{color:var(--muted);font-size:11px}.refill-extra{display:none}.refill-history.expanded .refill-extra{display:grid}.refill-toggle{margin-top:.7rem}
.document-choice{align-items:center}.document-choice>span{flex:1;text-align:center;align-items:center}.document-choice input{flex:0 0 auto}
.document-preview-shell{display:grid;gap:16px}.document-preview-frame{width:100%;height:70vh;min-height:520px;border:1px solid var(--line);border-radius:14px;background:#fff}.document-actions{display:flex;gap:8px;flex-wrap:wrap}.pdf-preview[hidden],.pdf-actions[hidden]{display:none}
@media(max-width:700px){.refill-row{grid-template-columns:1fr 1fr}.med-summary-status{grid-auto-flow:row}}

/* 1.4.0 medication, memorial, PDF and Solaris theme refinements */
.form-actions{gap:8px;flex-wrap:wrap}
.theme-swatch.sunos-lavender{background:linear-gradient(180deg,#d9d2e4 0 25%,#9a8daa 25% 48%,#c9c1d2 48% 74%,#675b73 74%)}
body[data-theme="sunos-lavender"]{--bg:#aea7ba;--surface:#d8d0df;--surface2:#d0c7d8;--text:#17131c;--muted:#554e5d;--line:#746c7c;--blue:#67547a;--blue2:#493b58;--radius:2px;--shadow:2px 2px 0 #625b6a,-1px -1px 0 #f0e9f5;background:#aea7ba;font-family:"Nimbus Sans",Helvetica,Arial,sans-serif}
body[data-theme="sunos-lavender"] header{background:#c9c1d2;border-bottom:2px solid #6f6678;backdrop-filter:none;-webkit-backdrop-filter:none}
body[data-theme="sunos-lavender"] .surface,body[data-theme="sunos-lavender"] .pet-card,body[data-theme="sunos-lavender"] .record-item,body[data-theme="sunos-lavender"] .record-accordion,body[data-theme="sunos-lavender"] .theme-tile{border-radius:2px;background:#d8d0df;border:1px solid #756d7d;box-shadow:inset 1px 1px 0 #f2ebf6,inset -1px -1px 0 #958b9e,2px 2px 0 #645d6c}
body[data-theme="sunos-lavender"] .button,body[data-theme="sunos-lavender"] button,body[data-theme="sunos-lavender"] input,body[data-theme="sunos-lavender"] select,body[data-theme="sunos-lavender"] textarea{border-radius:1px}
body[data-theme="sunos-lavender"] input,body[data-theme="sunos-lavender"] select,body[data-theme="sunos-lavender"] textarea{background:#eee8f1;border:1px inset #958c9d;color:#17131c}
body[data-theme="sunos-lavender"] .record-accordion>summary{background:#c8bfd0}
body[data-theme="sunos-lavender"] .brand-mark{border-radius:2px;background:#756283;color:#fff;box-shadow:inset 1px 1px 0 #b6a9c0,inset -1px -1px 0 #4c4057}
body[data-theme="sunos-lavender"] .attention-badge{border-radius:1px;background:#8b303d;box-shadow:inset 1px 1px #c98590,inset -1px -1px #551923}
/* Memorial cards remain distinct, but derive their treatment from each theme. */
body[data-theme="classic"] .memorial-card{background:linear-gradient(145deg,#fffdf8,#eee6da);border-color:#cdbda7}
body[data-theme="glass"] .memorial-card{background:linear-gradient(145deg,rgba(255,255,255,.68),rgba(184,168,208,.44));border-color:rgba(255,255,255,.82);box-shadow:0 14px 36px rgba(83,69,109,.12)}
body[data-theme="emr"] .memorial-card{background:linear-gradient(145deg,#e9efec,#d7e1dc);border-color:#9fb2aa}
body[data-theme="midnight"] .memorial-card{background:linear-gradient(145deg,#27252d,#302b39);border-color:#665d72}
body[data-theme="midnight"] .memorial-card .memorial-line,body[data-theme="midnight"] .memorial-card .memorial-cross{color:#d6c2e4}
body[data-theme="sunos"] .pet-card.memorial-card{background:#c6bda9;border-color:#6f6657;box-shadow:inset 1px 1px 0 #eee5d1,inset -1px -1px 0 #8f856f,2px 2px 0 #625c50}
body[data-theme="sunos"] .memorial-card .memorial-line,body[data-theme="sunos"] .memorial-card .memorial-cross{color:#5d4630}
body[data-theme="sunos-lavender"] .pet-card.memorial-card{background:#bcb0c7;border-color:#675b71;box-shadow:inset 1px 1px 0 #ebe1f1,inset -1px -1px 0 #8c7f98,2px 2px 0 #5f5667}
body[data-theme="sunos-lavender"] .memorial-card .memorial-line,body[data-theme="sunos-lavender"] .memorial-card .memorial-cross{color:#513d5e}
@keyframes zero-days-pulse{0%,100%{opacity:1;transform:scale(1)}50%{opacity:.36;transform:scale(1.045)}}
.days-chip.zero-days{background:var(--danger)!important;color:#fff!important;font-weight:800;animation:zero-days-pulse 1.15s ease-in-out infinite}
@media (prefers-reduced-motion:reduce){.days-chip.zero-days{animation:none;text-decoration:underline}}
.document-choice{min-width:0;overflow:hidden}.document-choice-text{min-width:0;width:100%;max-width:100%;text-align:center;align-items:center}.document-title,.document-filename{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}.document-filename{width:min(100%,34rem);margin-inline:auto}
.pdf-email-preview{max-width:560px}.pdf-email-preview label{margin-bottom:0}

/* 1.5.0 Complete PDF selection fixes */
.document-choice{display:grid;grid-template-columns:28px minmax(0,1fr);align-items:center;width:100%;overflow:hidden}
.document-choice>input[type="checkbox"]{width:18px;min-width:18px;height:18px;margin:0;justify-self:center}
.document-choice-text{min-width:0;width:100%;overflow:hidden;text-align:center;align-items:center;justify-content:center}
.document-title,.document-filename{display:block;width:100%;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center}
.document-filename{margin-inline:auto}

/* 1.6.0 Veterinary Facilities CRUD visibility + Weight History lightbox */
.facility-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px}.facility-add-panel{display:none}.facility-add-panel.facility-add-panel-open{display:block}.facility-editor{margin-top:14px}.facility-editor[open]{padding-bottom:8px}.lightbox-trigger{cursor:zoom-in;transition:transform .15s ease,box-shadow .15s ease}.lightbox-trigger:hover,.lightbox-trigger:focus{transform:scale(1.02);box-shadow:0 10px 28px rgba(20,30,45,.18);outline:none}.lightbox-open{overflow:hidden}.photo-lightbox{position:fixed;inset:0;z-index:1000;display:grid;place-items:center;padding:24px}.photo-lightbox-backdrop{position:absolute;inset:0;width:100%;height:100%;border:0;background:rgba(8,12,18,.74);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);cursor:zoom-out}.photo-lightbox-card{position:relative;z-index:1;display:grid;place-items:center;max-width:min(94vw,1200px);max-height:92vh;padding:14px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);box-shadow:0 32px 110px rgba(0,0,0,.38)}.photo-lightbox-card img{display:block;max-width:calc(94vw - 28px);max-height:calc(92vh - 28px);width:auto;height:auto;object-fit:contain;border-radius:calc(var(--radius) * .7)}.photo-lightbox-x{position:absolute;right:18px;top:18px;z-index:2;width:38px;height:38px;border:1px solid rgba(255,255,255,.28);border-radius:50%;background:rgba(15,20,28,.7);color:#fff;font-size:25px;line-height:1;cursor:pointer}
.document-preview-object{display:block}.document-preview-image{display:block;max-width:100%;max-height:75vh;width:auto;height:auto;margin:0 auto;border-radius:14px;border:1px solid var(--line);background:#fff}.preview-fallback{display:grid;place-items:center;gap:12px;min-height:320px;padding:30px;text-align:center;color:var(--muted)}

/* 1.7.0 profile summary, attention parity, and medical follow-ups */
.profile-summary-table{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:18px 0;overflow:hidden}.profile-summary-column{padding:18px 20px;border-right:1px solid var(--line)}.profile-summary-column:last-child{border-right:0}.profile-summary-column dl{margin:0}.profile-summary-column dl>div{display:grid;grid-template-columns:minmax(90px,.8fr) minmax(0,1.4fr);gap:10px;padding:6px 0;border-bottom:1px solid rgba(127,145,167,.1)}.profile-summary-column dl>div:last-child{border-bottom:0}.profile-summary-column dt{font-size:10px;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}.profile-summary-column dd{margin:0;font-size:12px;overflow-wrap:anywhere}.upcoming-followup dd strong{color:var(--blue)}.attention-row-label{display:inline-flex;width:max-content;margin:2px 0;padding:3px 7px;border-radius:999px;background:#b91c1c;color:#fff;font-style:normal;font-size:9px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}.visit-summary-dates{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.followup-fields{border:1px solid var(--line);border-radius:12px;padding:12px}.followup-fields legend{padding:0 6px;font-size:11px;font-weight:800;color:var(--blue)}.followup-history{margin:12px 0;padding:12px;border-radius:12px;background:rgba(127,145,167,.07)}.followup-history>strong{font-size:11px;text-transform:uppercase;letter-spacing:.06em}.followup-history-row{display:grid;grid-template-columns:1fr auto;gap:12px;padding:6px 0;border-bottom:1px solid rgba(127,145,167,.12);font-size:12px}.followup-history-row:last-child{border-bottom:0}.status-word{text-transform:capitalize;font-weight:700}.followup-complete{margin:10px 0}
@media(max-width:850px){.profile-summary-table{grid-template-columns:1fr}.profile-summary-column{border-right:0;border-bottom:1px solid var(--line)}.profile-summary-column:last-child{border-bottom:0}.visit-summary-dates{justify-content:flex-start}}

/* 1.8.2 medication critical-row and history fixes */
.record-item.status-danger,
body[data-theme="classic"] .record-item.status-danger,
body[data-theme="glass"] .record-item.status-danger,
body[data-theme="emr"] .record-item.status-danger,
body[data-theme="midnight"] .record-item.status-danger,
body[data-theme="sunos"] .record-item.status-danger,
body[data-theme="sunos-lavender"] .record-item.status-danger{
  background:rgba(254,226,226,.94)!important;
  border-color:#dc2626!important;
  box-shadow:0 0 0 1px rgba(220,38,38,.16)!important;
}
body[data-theme="midnight"] .record-item.status-danger{background:#4a2228!important;border-color:#ef6673!important}
body[data-theme="sunos"] .record-item.status-danger{background:#e4b7b2!important;border-color:#8b2323!important;box-shadow:inset 1px 1px 0 #f7dedb,inset -1px -1px 0 #a15b55!important}
body[data-theme="sunos-lavender"] .record-item.status-danger{background:#dfb6bf!important;border-color:#8b303d!important;box-shadow:inset 1px 1px 0 #f4dce1,inset -1px -1px 0 #a45d68!important}
.record-item.status-danger>summary{color:#991b1b!important}
body[data-theme="midnight"] .record-item.status-danger>summary{color:#ffd9dd!important}
.ended-medication-label{display:inline-flex;width:max-content;margin:2px 0;padding:3px 7px;border-radius:999px;background:rgba(100,116,139,.16);color:var(--muted);font-style:normal;font-size:9px;font-weight:800;letter-spacing:.05em;text-transform:uppercase}
.medication-ended{opacity:.78;background:rgba(148,163,184,.08)!important;border-style:dashed!important}
.medication-ended .days-chip{animation:none!important}
.end-medication-form{display:flex;align-items:end;gap:.65rem;flex-wrap:wrap;margin:1rem 0;padding:12px;border:1px solid var(--line);border-radius:12px;background:rgba(127,145,167,.06)}
.end-medication-form label{margin:0}

/* 1.9.0 admin/reminder and medication-history refinements */
.settings-category-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:1rem 0}
.settings-category{border:1px solid rgba(148,163,184,.35);border-radius:14px;padding:1rem;background:rgba(255,255,255,.28)}
.settings-category legend{font-weight:800;padding:0 .35rem}.settings-category label{display:block;margin:.55rem 0}
.status-strip{display:flex;flex-wrap:wrap;gap:.55rem;margin-top:1rem}.status-strip span{padding:.42rem .65rem;border-radius:999px;background:rgba(148,163,184,.15);font-size:.82rem;font-weight:700}
.medication-section-key{display:flex;gap:.75rem;flex-wrap:wrap;margin:0 0 .8rem}.medication-section-key span{padding:.45rem .65rem;border-radius:10px;background:rgba(148,163,184,.12)}.medication-section-key em{font-style:normal;font-weight:800}
.field-note{align-self:end;padding:.65rem;border-radius:10px;background:rgba(148,163,184,.12);font-size:.84rem}
@media(max-width:850px){.settings-category-grid{grid-template-columns:1fr}}

/* 1.9.2 release-blocking medication zero-inventory visibility */
.record-item.medication-zero,
body[data-theme="classic"] .record-item.medication-zero,
body[data-theme="glass"] .record-item.medication-zero,
body[data-theme="emr"] .record-item.medication-zero,
body[data-theme="midnight"] .record-item.medication-zero,
body[data-theme="sunos"] .record-item.medication-zero,
body[data-theme="sunos-lavender"] .record-item.medication-zero{
  background:#fee2e2!important;
  border:2px solid #dc2626!important;
  box-shadow:0 0 0 1px rgba(220,38,38,.20)!important;
}
.record-item.medication-zero>summary{background:transparent!important;color:#991b1b!important}
body[data-theme="midnight"] .record-item.medication-zero{background:#4a2228!important;border-color:#ef6673!important}
body[data-theme="midnight"] .record-item.medication-zero>summary{color:#ffd9dd!important}
body[data-theme="sunos"] .record-item.medication-zero{background:#e4b7b2!important;border-color:#8b2323!important}
body[data-theme="sunos-lavender"] .record-item.medication-zero{background:#dfb6bf!important;border-color:#8b303d!important}

/* 1.9.2 medication history, discontinue workflow, and follow-up reminder row states */
.medication-history-trigger{border:0;font:inherit;color:inherit;cursor:pointer;padding:.45rem .65rem;border-radius:10px;background:rgba(148,163,184,.12);display:inline-flex;gap:.35rem;align-items:center}.medication-history-trigger:hover,.medication-history-trigger:focus-visible{outline:2px solid var(--blue);outline-offset:2px}.medication-history-dialog{border:0;padding:0;background:transparent;max-width:min(760px,92vw);width:100%}.medication-history-dialog::backdrop{background:rgba(15,23,42,.62);backdrop-filter:blur(3px)}.medication-history-modal{background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:16px;box-shadow:0 24px 70px rgba(0,0,0,.3);max-height:82vh;overflow:auto;padding:18px}.modal-header{display:flex;justify-content:space-between;align-items:flex-start;gap:16px;position:sticky;top:0;background:var(--surface);z-index:2;padding-bottom:10px}.medication-history-modal-list{display:grid;gap:12px}.medication-history-entry{border:1px solid var(--line);border-radius:12px;padding:12px;background:rgba(127,145,167,.05)}.medication-history-entry>div:first-child{display:flex;justify-content:space-between;gap:12px}.medication-history-entry dl{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px 16px}.medication-history-entry dl div{display:grid;grid-template-columns:90px 1fr;gap:8px}.medication-history-entry dt{color:var(--muted);font-size:10px;text-transform:uppercase}.medication-history-entry dd{margin:0}.history-refills{margin-top:10px;padding-top:10px;border-top:1px solid var(--line)}.history-refill-row{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;font-size:11px;padding:5px 0}.medication-status-actions{margin:12px 0;padding:12px;border:1px solid var(--line);border-radius:12px;background:rgba(127,145,167,.05)}
.profile-summary-column dl>div.medical-followup-reminder-row{border-radius:8px;margin:4px 0;padding:8px 9px;border-bottom:0!important}.profile-summary-column dl>div.medical-followup-reminder-row.followup-current{background:#dcfce7!important;border:1px solid #86efac!important;color:#14532d!important}.profile-summary-column dl>div.medical-followup-reminder-row.followup-overdue{background:#fee2e2!important;border:1px solid #fca5a5!important;color:#7f1d1d!important}.profile-summary-column dl>div.medical-followup-reminder-row.followup-current dt,.profile-summary-column dl>div.medical-followup-reminder-row.followup-current dd,.profile-summary-column dl>div.medical-followup-reminder-row.followup-current strong{color:#14532d!important}.profile-summary-column dl>div.medical-followup-reminder-row.followup-overdue dt,.profile-summary-column dl>div.medical-followup-reminder-row.followup-overdue dd,.profile-summary-column dl>div.medical-followup-reminder-row.followup-overdue strong{color:#7f1d1d!important}
body[data-theme="midnight"] .profile-summary-column dl>div.medical-followup-reminder-row.followup-current{background:#173d2b!important;border-color:#3e9b64!important}body[data-theme="midnight"] .profile-summary-column dl>div.medical-followup-reminder-row.followup-current dt,body[data-theme="midnight"] .profile-summary-column dl>div.medical-followup-reminder-row.followup-current dd,body[data-theme="midnight"] .profile-summary-column dl>div.medical-followup-reminder-row.followup-current strong{color:#d1fae5!important}body[data-theme="midnight"] .profile-summary-column dl>div.medical-followup-reminder-row.followup-overdue{background:#4a2228!important;border-color:#ef6673!important}body[data-theme="midnight"] .profile-summary-column dl>div.medical-followup-reminder-row.followup-overdue dt,body[data-theme="midnight"] .profile-summary-column dl>div.medical-followup-reminder-row.followup-overdue dd,body[data-theme="midnight"] .profile-summary-column dl>div.medical-followup-reminder-row.followup-overdue strong{color:#ffd9dd!important}

.file-clear-button{margin-top:.45rem;display:inline-flex}.file-clear-button[hidden]{display:none!important}
.document-viewer-surface{padding:.75rem}.document-inline-frame{display:block;width:100%;height:min(78vh,1000px);border:0;border-radius:.75rem;background:#fff}
