:root{--bg:#f6f2ed;--paper:#fff;--ink:#3d3531;--accent:#886b53;--soft:#f3e8dc;--line:#e6d9ce;--muted:#796e67}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%}body{margin:0;background:var(--bg);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;line-height:1.55}main{max-width:520px;margin:auto;padding:12px 12px 30px}.panel{background:var(--paper);padding:18px 16px;border-radius:20px;box-shadow:0 2px 15px #48392e12;min-height:55vh}.hidden{display:none!important}.version{font-size:.76rem;color:var(--muted)}h1{text-align:center;font-size:1.55rem;margin:8px 0 16px}h2{font-size:1.35rem;margin:0 0 14px}h3{font-size:1.03rem;margin:20px 0 10px}.center{text-align:center}.muted{color:var(--muted);font-size:.88rem}.hero-photo{height:205px;background:linear-gradient(135deg,#efe0d2,#d5c3b5);border-radius:16px;display:flex;justify-content:center;align-items:center;overflow:hidden;color:#6d5544}.hero-photo img{width:100%;height:100%;object-fit:cover}.wide{width:100%;display:block;margin:10px 0}button{background:var(--accent);color:white;border:0;border-radius:11px;min-height:44px;padding:10px 14px;font:inherit;font-weight:600;cursor:pointer}button.secondary{background:var(--soft);color:var(--ink)}button.small{padding:6px 13px;min-height:36px;font-size:.9rem}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #7791ba;outline-offset:2px}input,select,textarea{font:inherit;color:var(--ink);border:1px solid #d9c8b9;border-radius:9px;padding:10px;background:white;width:100%;max-width:100%}label{display:block;margin:12px 0 5px;font-weight:600}label input,label select{margin-top:5px}.check-label{display:flex;align-items:center;gap:10px}.check-label input{width:auto;margin:0;transform:scale(1.2)}.summary{background:#faf5ef;padding:13px;border-radius:11px;white-space:pre-wrap;margin:12px 0}.month,.history-nav{display:flex;align-items:center;justify-content:space-between;gap:8px}.month button{font-size:1.5rem;min-width:44px}.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;margin:12px 0}.calendar .weekday{text-align:center;font-size:.8rem;color:var(--muted)}.calendar button{padding:5px 0;min-width:0;min-height:42px;background:#faf7f3;color:var(--ink);font-size:.9rem}.calendar button.selected{background:var(--accent);color:white}.calendar button.has-record:not(.selected){border:2px solid var(--accent)}.calories{display:grid;grid-template-columns:1fr 1fr;gap:8px;background:var(--soft);padding:13px;border-radius:12px}.calories small{display:block;color:var(--muted)}.calories strong{font-size:1.17rem}.record-card,.meal-card{border:1px solid var(--line);border-radius:12px;padding:12px;margin:10px 0}.meal-card,.memo-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.meal-card .details{flex:1;min-width:0;white-space:pre-wrap}.meal-card small{display:block;color:var(--muted)}.count-row{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:12px 2px;border-bottom:1px solid var(--line)}.count-row label{margin:0;flex:1;white-space:nowrap}.count-row select{width:110px;flex-shrink:0}.memo-head h3{margin:12px 0}.meal-edit-row{border:1px solid var(--line);border-radius:12px;padding:10px;margin:10px 0}.meal-edit-row label{font-size:.88rem}.meal-edit-row .row-controls{display:grid;grid-template-columns:1fr 1fr;gap:10px}.meal-edit-row .row-controls>*{min-width:0}.meal-edit-row .row-kcal{color:var(--muted);font-size:.88rem}.record-card .line{display:flex;justify-content:space-between;gap:12px;margin:7px 0}.alerts{margin-top:20px}.alert{padding:10px;border-radius:10px;background:#fff2dc;margin:7px 0}.history-nav strong{text-align:center;font-size:.9rem}.status{font-size:.87rem;color:#655c54;margin:12px 0;white-space:pre-wrap}.food-item{border-bottom:1px solid var(--line);padding:10px 0}.food-item button{margin:5px 5px 0 0;min-height:36px}.danger{background:#a45454}body.lavender{--bg:#f6f2fa;--accent:#8069a4;--soft:#efe8f8;--line:#e2d9ef}body.font-large{font-size:19px}body.font-small{font-size:14px}@media(max-width:360px){.panel{padding:14px 11px}.count-row select{width:95px}.history-nav button{padding:8px}}

.home-profile{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:13px 0;padding:13px;border:1px solid var(--line);border-radius:13px;background:#faf7f3}.profile-field{min-width:0}.profile-field small{display:block;color:var(--muted);font-size:.77rem}.profile-field strong{display:block;font-size:.94rem;overflow-wrap:anywhere}body.lavender .home-profile{background:#f8f4fc}

.meal-running-total{margin-top:8px;font-weight:700;background:var(--soft);border-radius:10px}

.home-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.weight-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
#removeWeight { margin-top: 8px; }
#weightPlot { width: 100%; height: auto; }
#weightHistory { margin: 12px 0; }
.medicine-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

#medicineHistory {margin: 14px 0; padding: 12px; border: 1px solid var(--line); border-radius: 11px;}
#medicineHistory summary {cursor: pointer; font-weight: 600;}

/* v0.1.12 themes and attached observations */
body[data-theme="paw"]{--bg:#fcf0f3;--paper:#fffafd;--ink:#634754;--accent:#bc7996;--soft:#f8e2e9;--line:#edd2dc;--muted:#866b77}
body[data-theme="botanical"]{--bg:#e8eee3;--paper:#fffefa;--ink:#344e3d;--accent:#668968;--soft:#e3eee0;--line:#cbdacb;--muted:#617563}
body[data-theme="moon"]{--bg:#f4e8f1;--paper:#fff9fe;--ink:#513b5d;--accent:#88608e;--soft:#f0ddec;--line:#dfc6dc;--muted:#76647c}
body[data-theme="sakura"]{--bg:#fff0f3;--paper:#fffdfd;--ink:#674451;--accent:#cf8ea4;--soft:#fbe3e9;--line:#f1cdd8;--muted:#886b75}
body[data-theme="hydrangea"]{--bg:#edf0fc;--paper:#fff;--ink:#41476a;--accent:#7886c1;--soft:#e6eafa;--line:#d4dcf4;--muted:#6c7592}
body[data-theme="autumn"]{--bg:#faf0e1;--paper:#fffefa;--ink:#634932;--accent:#b27a4c;--soft:#f6e4ce;--line:#ead3b8;--muted:#87715f}
body[data-theme="snow"]{--bg:#edf5fa;--paper:#fff;--ink:#405a6b;--accent:#709bb6;--soft:#e2f0f7;--line:#cce1ec;--muted:#6e8695}
body[data-theme="navy"]{--bg:#192333;--paper:#273448;--ink:#f0f3fa;--accent:#7899c5;--soft:#34455e;--line:#485d78;--muted:#b6c3d6}
body[data-theme="black"]{--bg:#17191e;--paper:#26282f;--ink:#f2f2f4;--accent:#9299a8;--soft:#343741;--line:#484c58;--muted:#bfc2cb}
body[data-theme] .summary,body[data-theme] .home-profile,body[data-theme] .calendar button:not(.selected){background:var(--soft)}body[data-theme] input,body[data-theme] select,body[data-theme] textarea{background:var(--paper);color:var(--ink);border-color:var(--line)}body[data-theme] .status{color:var(--muted)}body[data-theme] .hero-photo{background:var(--soft);color:var(--ink)}body[data-theme] .alert{background:var(--soft);color:var(--ink)}body[data-theme] button:not(.secondary):not(.danger){color:#fff}body[data-theme="navy"] button:not(.secondary):not(.danger),body[data-theme="black"] button:not(.secondary):not(.danger){color:#111821}body[data-theme="navy"] .calendar button.selected,body[data-theme="black"] .calendar button.selected{color:#111821}.cat-corner{text-align:right;font-size:1.35rem;color:var(--accent);padding:4px 8px 0;white-space:nowrap}.photo-note-card{overflow:hidden}.photo-note-text{white-space:pre-wrap;overflow-wrap:anywhere}.photo-note-img{display:block;width:auto;max-width:100%;max-height:300px;object-fit:contain;border-radius:10px;margin:10px auto;cursor:zoom-in}.backup-reminder button{margin:5px 6px 0 0}.backup-reminder p{margin:6px 0}body[data-theme="navy"] .hero-photo,body[data-theme="black"] .hero-photo{background:var(--soft)}
/* v0.1.13: decoration fits entirely; never overlays controls */
.theme-art{display:none;height:190px;margin:0 auto 12px;border-radius:14px;overflow:hidden;background:var(--soft);align-items:center;justify-content:center}
.theme-art img{display:block;width:100%;height:100%;object-fit:contain}
body[data-theme="moon"] .theme-art{display:flex}
.cat-corner{height:78px;display:flex;justify-content:flex-end;align-items:center;overflow:visible}
.cat-corner img{width:100px;height:74px;object-fit:contain;object-position:center bottom;filter:drop-shadow(0 2px 2px #0002)}
.compare-controls{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.compare-controls label{min-width:0;font-size:.9rem}.compare-controls select{font-size:.88rem}
.compare-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-top:12px}
.compare-side{min-width:0;border:1px solid var(--line);border-radius:12px;padding:8px;overflow-wrap:anywhere}
.compare-side img{display:block;width:100%;height:210px;object-fit:contain;background:var(--soft);border-radius:8px;margin-top:6px}
.compare-side p{white-space:pre-wrap;font-size:.82rem}
@media(max-width:390px){.compare-side img{height:165px}.compare-controls{gap:6px}}

/* v0.1.16: keep decorative illustrations clear of the working area */
body[data-theme="moon"] #home{position:relative}
body[data-theme="moon"] #home h1{margin-bottom:4px}
body[data-theme="moon"] .theme-art{display:flex;width:100%;height:82px;margin:0 auto 12px;background:transparent;justify-content:flex-end;overflow:visible}
body[data-theme="moon"] .theme-art img{width:100px;height:82px;object-fit:contain;object-position:center;filter:drop-shadow(0 2px 3px #44304c22)}
body[data-theme="moon"] .cat-corner{border-top:1px dotted var(--line);margin-top:12px}
.compare-side{position:relative}
.compare-date{display:inline-block;font-size:.8rem;font-weight:700;color:var(--ink);margin-left:8px}
.compare-hints{font-size:.8rem;color:var(--muted);text-align:center;margin:12px 0}
.compare-hints p{margin:4px 0}
@media (orientation:landscape) and (pointer:coarse) and (max-height:650px){
  body:has(#photoCompare:not(.hidden)){overflow:hidden}
  body:has(#photoCompare:not(.hidden)) main{max-width:none;padding:0}
  #photoCompare:not(.hidden){position:fixed;inset:0;z-index:1000;width:100vw;height:100dvh;min-height:0;padding:4px 8px;border-radius:0;box-shadow:none;overflow:hidden;display:flex;flex-direction:column}
  #photoCompare:not(.hidden)>h2,#photoCompare:not(.hidden)>p,#photoCompare:not(.hidden) .compare-controls,
  #photoCompare:not(.hidden) .compare-hints,#photoCompare:not(.hidden) .compare-back,
  #photoCompare:not(.hidden) .compare-side-heading,#photoCompare:not(.hidden) .compare-side p{display:none!important}
  #photoCompare:not(.hidden) .compare-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;flex:1;min-height:0;margin:0}
  #photoCompare:not(.hidden) .compare-side{display:flex;align-items:center;justify-content:center;padding:2px;min-height:0;min-width:0;overflow:hidden}
  #photoCompare:not(.hidden) .compare-side img{width:100%;height:100%;max-height:100%;margin:0;object-fit:contain;background:transparent}
  #photoCompare:not(.hidden) .compare-date{position:absolute;top:5px;left:5px;z-index:2;margin:0;padding:2px 6px;border-radius:5px;background:#000a;color:#fff;font-size:12px;line-height:1.35}
}

/* v0.1.16: dedicated moon accent and edge-to-edge medical photo comparison */
body[data-theme="moon"] .theme-art{height:104px;margin:0 0 8px;justify-content:flex-end;background:none;border:0}
body[data-theme="moon"] .theme-art img{width:124px;height:104px;object-fit:contain;object-position:right center}
@media (orientation:landscape) and (pointer:coarse) and (max-height:650px){
  #photoCompare:not(.hidden){padding:0!important;margin:0!important;max-width:none!important;max-height:none!important;border:0!important;background:#141519!important}
  #photoCompare:not(.hidden) .compare-grid{width:100%;height:100%;gap:2px!important;margin:0!important;padding:0!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:stretch!important}
  #photoCompare:not(.hidden) .compare-side{border:0!important;border-radius:0!important;padding:0!important;margin:0!important;min-height:0!important;background:#141519!important;position:relative!important}
  #photoCompare:not(.hidden) .compare-side img{display:block!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;border:0!important;border-radius:0!important;margin:0!important;padding:0!important;background:transparent!important}
  #photoCompare:not(.hidden) .compare-date{top:8px!important;left:8px!important;font-size:clamp(14px,2.5vw,19px)!important;font-weight:800!important;padding:4px 9px!important;background:#000c!important;color:#fff!important;text-shadow:0 1px 2px #000}
}

/* v0.1.17: one unobtrusive cat silhouette at the bottom of home */
body[data-theme="moon"] .theme-art{display:none!important}
body[data-theme="moon"] .cat-corner{border-top:0!important}
.cat-corner{height:96px;justify-content:flex-end;overflow:hidden}
.cat-corner img{height:92px;width:110px;object-fit:contain;filter:none}
/* Side-by-side photos touch at the center while retaining the entire image */
@media (orientation:landscape) and (pointer:coarse) and (max-height:650px){
 #photoCompare:not(.hidden) .compare-grid{gap:0!important;column-gap:0!important}
 #photoCompare:not(.hidden) .compare-side:first-child{justify-content:flex-end!important}
 #photoCompare:not(.hidden) .compare-side:last-child{justify-content:flex-start!important}
 #photoCompare:not(.hidden) .compare-side img{width:auto!important;height:auto!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;flex:0 1 auto!important}
}

/* v0.1.18: subtle cat watermark on every page, in every theme */
main > .panel{position:relative;isolation:isolate}
main > .panel::before{content:"";position:absolute;right:14px;bottom:14px;width:100px;height:100px;background:url("assets/cat-only-silhouette.png") center / contain no-repeat;opacity:.16;pointer-events:none;z-index:-1}
main > .panel > *{position:relative}
/* Keep comparison photographs clear and undistorted. */
#photoCompare::before{opacity:.10}
@media (orientation:landscape) and (pointer:coarse) and (max-height:650px){#photoCompare::before{display:none}}
main > .panel::before{z-index:0}
main > .panel > *{z-index:1}

/* v0.1.19: keep the landscape comparison at full height when a date has no photo. */
@media (orientation:landscape) and (pointer:coarse) and (max-height:650px){
 #photoCompare:not(.hidden) #compareEmpty:not(.hidden){
  position:absolute!important;left:50%;bottom:8px;top:auto;transform:translateX(-50%);
  z-index:5!important;width:max-content;max-width:calc(100vw - 24px);
  padding:5px 10px!important;margin:0!important;border-radius:8px;
  background:rgba(0,0,0,.75)!important;color:#fff!important;
  font-size:11px;line-height:1.35;text-align:center;pointer-events:none;
 }
}

/* v0.1.20: dedicated, visible cat silhouette area beneath page content */
main > .panel::before{display:none!important}
.ame-footer{position:relative!important;z-index:1!important;display:flex;align-items:flex-end;justify-content:flex-end;min-height:154px;margin-top:30px;padding:18px 6px 0;border-top:1px solid var(--line);background:transparent;clear:both}
.ame-footer img{display:block;width:128px;height:128px;object-fit:contain;opacity:.82;flex:none}
.ame-home-footer{justify-content:space-between;gap:12px}
.ame-credits{display:flex;flex-direction:column;gap:5px;align-self:flex-end;padding-bottom:12px;font-size:.78rem;color:var(--muted);line-height:1.5}
.ame-credits strong{color:var(--ink)}
@media(max-width:360px){.ame-footer img{width:104px;height:112px}.ame-credits{font-size:.7rem}}
@media (orientation:landscape) and (pointer:coarse) and (max-height:650px){#photoCompare:not(.hidden) .ame-footer{display:none!important}}

/* Multiple-pet prototype */
#petSwitcher{margin:0 0 14px}#petSwitcher label{display:block;font-weight:600}#petSwitcher select{width:100%;margin-top:5px}#petManager{padding:12px;border:1px solid #c9b7a5;border-radius:12px;margin:12px 0 20px}.pet-manager-row{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid #c9b7a544}.pet-manager-row small{opacity:.7}#everyoneList .record-card{margin:12px 0}
