:root{--forest:#183f35;--forest2:#275f4b;--mint:#e2ede5;--cream:#f9f9f5;--paper:#fff;--ink:#273c33;--muted:#72837a;--line:#e2e9e2;--orange:#b36a39;--soft-orange:#fff0e6;--soft-yellow:#fff7de;--shadow:0 6px 24px #173a2910}*{box-sizing:border-box}html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}body{margin:0;background:var(--cream);color:var(--ink);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;font-size:14px}button,input,textarea{font:inherit}button{cursor:pointer}a{color:inherit}button:focus-visible,input:focus-visible,textarea:focus-visible,a:focus-visible{outline:3px solid #82b89c;outline-offset:2px}.shell{display:grid;grid-template-columns:250px minmax(0,1fr);max-width:1440px;margin:auto;min-height:100dvh}.sidebar{background:var(--mint);border-right:1px solid var(--line);padding:28px 19px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:10px;color:var(--forest)}.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:var(--forest);font-size:22px}.brand strong{display:block;font-size:22px;letter-spacing:-.8px;line-height:1.15}.brand small{display:block;font-size:10px;letter-spacing:.06em;color:#658474;margin-top:5px}.side-label{font-size:10px;font-weight:800;letter-spacing:.16em;color:#96a79b;margin:42px 0 14px 13px}.nav-item{display:flex;align-items:center;gap:13px;border:0;border-radius:12px;padding:14px 15px;width:100%;background:none;text-align:left;color:#688073;font-weight:700;margin:4px 0}.nav-item svg{width:19px;height:19px;stroke:currentColor;stroke-width:2;fill:none}.nav-item.active{background:var(--mint);color:var(--forest)}.side-end{margin-top:auto}.small-info{background:white;border:1px solid var(--line);border-radius:16px;padding:18px;font-size:12px;line-height:1.6;color:var(--muted)}.small-info b{color:var(--forest)}.small-info p{margin:5px 0 0}.version{display:block;margin:15px 8px 0;font-size:10px;color:#8b9c90}.main{min-width:0;padding:38px clamp(18px,4vw,65px) 95px}.mobile-head,.mobile-nav{display:none}.page-head{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:27px}.eyebrow{font-size:11px;font-weight:800;letter-spacing:.14em;color:#7b9987;text-transform:uppercase;margin:0 0 10px}.page-head h1{font-size:clamp(26px,3.5vw,37px);line-height:1.12;letter-spacing:-1.5px;margin:0;font-weight:820;color:#1a4535}.page-head p{color:var(--muted);margin:10px 0 0;line-height:1.5}.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;border:1px solid var(--line);border-radius:11px;min-height:43px;padding:11px 15px;background:white;color:var(--forest);font-size:13px;font-weight:750;text-decoration:none;white-space:nowrap}.btn.primary{background:var(--forest);color:white;border-color:var(--forest)}.btn.subtle{background:#f3f6f0}.btn.danger{color:#a14b36;border-color:#edd4ce}.btn.mini{padding:7px 10px;min-height:35px;font-size:11px}.btn.whatsapp{background:#e9f8ee;border-color:#c8e9d0;color:#19734b}.btn:disabled{opacity:.5;cursor:not-allowed}.hero{border-radius:22px;background:linear-gradient(110deg,var(--forest),var(--forest2));padding:28px;display:flex;justify-content:space-between;gap:14px;align-items:center;color:white;box-shadow:var(--shadow);margin-bottom:22px}.hero h2{font-size:clamp(21px,3vw,28px);line-height:1.2;letter-spacing:-1px;margin:0 0 8px}.hero p{font-size:13px;line-height:1.6;color:#d8e9da;margin:0;max-width:540px}.hero .paw{font-size:62px;opacity:.9}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin-bottom:28px}.stat{background:white;border:1px solid var(--line);border-radius:17px;padding:18px;box-shadow:var(--shadow)}.stat .label{font-size:12px;color:var(--muted);font-weight:650}.stat strong{font-size:32px;color:var(--forest);display:block;margin:8px 0 3px}.stat strong.warning{color:var(--orange)}.stat small{font-size:11px;color:#98a79b}.section-title{display:flex;align-items:center;justify-content:space-between;gap:13px;margin:0 0 14px}.section-title h2{font-size:19px;letter-spacing:-.5px;margin:0}.section-title .quiet{margin:0}.panel{border:1px solid var(--line);border-radius:18px;background:#fff;overflow:hidden;box-shadow:var(--shadow)}.pet-row{padding:16px;display:flex;align-items:flex-start;gap:12px;border-bottom:1px solid #eff1eb}.pet-row:last-child{border-bottom:0}.avatar{display:grid;place-items:center;background:#ebf3ec;border-radius:13px;width:43px;height:43px;flex-shrink:0;font-size:22px}.pet-info{flex:1;min-width:0}.pet-info b{display:block;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.pet-info p{margin:4px 0;color:var(--muted);font-size:12px;line-height:1.45}.pet-side{display:flex;align-items:flex-end;flex-direction:column;gap:9px}.pill{background:#f0f5f1;color:#52705d;border-radius:99px;font-size:10px;white-space:nowrap;font-weight:800;padding:6px 9px}.pill.late{background:var(--soft-orange);color:#b9653c}.pill.soon{background:var(--soft-yellow);color:#937226}.pet-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.quiet{font-size:12px;color:var(--muted);line-height:1.6}.empty{padding:42px 22px;text-align:center;color:var(--muted)}.empty .emoji{display:block;font-size:40px;margin-bottom:9px}.empty b{display:block;color:var(--forest);font-size:16px}.empty p{max-width:330px;margin:8px auto 0;font-size:12px;line-height:1.5}.toolbar{display:flex;align-items:center;gap:10px;justify-content:space-between;margin-bottom:14px;flex-wrap:wrap}.search{border:1px solid var(--line);background:white;border-radius:11px;display:flex;align-items:center;padding:0 12px;min-height:43px;flex:1;max-width:450px}.search input{width:100%;background:transparent;border:0;outline:0;padding:11px 4px;font-size:13px}.filters{display:flex;gap:5px}.filter{padding:10px 12px;background:white;border:1px solid var(--line);border-radius:99px;color:var(--muted);font-weight:700;font-size:11px}.filter.active{color:white;background:var(--forest);border-color:var(--forest)}.settings-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px}.settings-card{padding:23px}.settings-card h2{font-size:18px;letter-spacing:-.5px;margin:0 0 8px}.settings-card p{color:var(--muted);font-size:12px;line-height:1.65;margin:5px 0 16px}.settings-card .btn{margin:0 0 9px}.settings-card .btn.full{display:flex;width:100%}.field{display:grid;gap:6px;margin-bottom:14px}.field label{font-size:12px;font-weight:750;color:#4b6758}.field input,.field textarea{background:#fff;border:1px solid #d7e3d9;border-radius:10px;padding:11px 12px;min-height:44px;width:100%;color:var(--ink);font-size:14px}.field textarea{resize:vertical}.field small{font-size:11px;color:var(--muted);line-height:1.45}.two-fields{display:grid;grid-template-columns:1fr 1fr;gap:11px}.soft-note{border-radius:12px;background:#f1f5ed;padding:13px;color:#577462;font-size:12px;line-height:1.5}.notice{border:1px solid #f0dfb5;border-radius:13px;background:#fff7de;padding:14px 16px;color:#856524;font-size:12px;line-height:1.5;margin-bottom:20px}.demo-banner{border:1px solid #cbddeb;border-radius:12px;background:#eef8ff;padding:14px;color:#3d6a8b;font-size:12px;line-height:1.6;margin-bottom:16px}.storage-banner{border:1px solid #edc7c2;border-radius:12px;background:#fff0f0;color:#9b3636;padding:15px;font-size:13px;line-height:1.6;margin-bottom:20px}.backup-tip{border-radius:13px;background:#f4f2e6;padding:14px 16px;font-size:12px;color:#857438;margin:0 0 20px}.tip-actions{margin-top:10px;display:flex;gap:10px}.tip-actions button{border:0;background:transparent;color:#5e5b30;font-weight:750;padding:4px}dialog{border:0;border-radius:20px;max-width:min(530px,calc(100vw - 24px));width:100%;padding:0;box-shadow:0 25px 85px #172b2859;max-height:88dvh;color:var(--ink)}dialog::backdrop{background:#15291bc4}.dlg-header{display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);padding:19px 22px}.dlg-header h2{font-size:19px;margin:0;letter-spacing:-.7px}.round-icon{width:33px;height:33px;border:0;background:#eef3ed;border-radius:50%;font-size:22px;color:var(--forest)}.dlg-body{padding:20px 22px 8px;overflow-y:auto;max-height:calc(88dvh - 160px)}.dlg-footer{display:flex;align-items:center;justify-content:flex-end;gap:9px;border-top:1px solid var(--line);padding:15px 22px}.history-entry{border-left:2px solid #c8ded0;padding:0 0 13px 13px;margin-bottom:10px}.history-entry b{font-size:13px}.history-entry p{color:var(--muted);font-size:12px;margin:5px 0}#toast{position:fixed;bottom:30px;left:50%;transform:translateX(-50%);background:#193c30;color:#fff;border-radius:12px;font-size:12px;padding:12px 16px;box-shadow:0 10px 35px #132e2850;opacity:0;pointer-events:none;transition:opacity .2s;z-index:99;max-width:calc(100vw - 30px);text-align:center}#toast.show{opacity:1}.mobile-head{align-items:center;justify-content:space-between;padding-bottom:19px}.install-help{display:grid;place-items:center;width:37px;height:37px;border:1px solid var(--line);border-radius:12px;text-decoration:none;font-weight:800}.footer-msg{font-size:11px;text-align:center;color:#a0aba0;padding:32px 0 0}
@media(max-width:950px){.shell{display:block}.sidebar{display:none}.main{padding:15px 15px 100px}.mobile-head{display:flex}.mobile-head .brand strong{font-size:21px}.mobile-nav{display:grid;grid-template-columns:repeat(4,1fr);position:fixed;bottom:0;bottom:env(safe-area-inset-bottom,0);width:100%;left:0;background:#fffffff0;border-top:1px solid var(--line);box-shadow:0 -6px 28px #263f3010;z-index:15;backdrop-filter:blur(12px)}.mobile-nav .nav-item{flex-direction:column;text-align:center;justify-content:center;gap:4px;padding:9px 2px;margin:0;font-size:10px;border-radius:0;min-height:58px}.mobile-nav .nav-item svg{width:21px;height:21px}.mobile-nav .nav-item.active{background:var(--mint)}.hero{padding:21px;min-height:126px}.hero .paw{font-size:42px}.settings-grid{grid-template-columns:1fr}.page-head h1{font-size:28px}.page-head{margin-bottom:20px}}@media(max-width:560px){.stats{gap:8px}.stat{padding:12px 10px;border-radius:13px}.stat strong{font-size:27px}.stat .label{font-size:10px}.stat small{font-size:10px}.hero .paw{font-size:35px}.page-head{align-items:flex-start}.page-head .btn{font-size:11px;padding:9px}.pet-row{flex-wrap:wrap;padding:14px 12px}.pet-side{width:100%;align-items:flex-start;flex-direction:row;justify-content:space-between}.pet-actions{justify-content:flex-end}.two-fields{gap:7px}.btn.mini{font-size:10px;padding:7px 8px}.settings-card{padding:19px}.dlg-body{padding:16px 17px 5px}.dlg-footer,.dlg-header{padding:14px 17px}.search{max-width:none;width:100%}.toolbar{display:grid}.filters{overflow-x:auto}}

/* Marca elegida por cada comprador. Mantener el mismo origen para conservar IndexedDB. */
.brand-mark{overflow:hidden;flex-shrink:0}
.brand-mark img,.brand-preview-logo img{width:100%;height:100%;object-fit:contain;display:block}
.brand strong{font-size:clamp(15px,1.6vw,21px);overflow-wrap:anywhere}
.brand small{letter-spacing:0;line-height:1.3}
.theme-field{border:0;margin:12px 0 17px;padding:0}
.theme-field legend{font-weight:750;font-size:12px;color:#4b6758;margin-bottom:10px}
.theme-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.theme-option{display:flex;align-items:center;gap:8px;padding:10px;border:1px solid var(--line);border-radius:12px;font-size:11px;font-weight:700;cursor:pointer;background:#fff}
.theme-option:has(input:checked){outline:2px solid var(--forest);outline-offset:-2px}
.theme-option input{accent-color:var(--forest);width:14px;height:14px;flex-shrink:0}
.theme-dot{width:20px;height:20px;border-radius:50%;border:2px solid #ffffffbf;box-shadow:0 0 0 1px #bcc5bd;flex-shrink:0}
.brand-preview{display:flex;align-items:center;gap:12px;background:var(--mint);border:1px solid var(--line);padding:15px;border-radius:14px;margin:0 0 17px;min-height:76px}
.brand-preview-logo{display:grid;place-items:center;width:48px;height:48px;background:#fff;border-radius:13px;overflow:hidden;flex-shrink:0;font-size:24px}
.brand-preview b{font-size:17px;color:var(--forest);display:block;overflow-wrap:anywhere}
.brand-preview small{display:block;font-size:11px;color:var(--muted);margin-top:3px}
.settings-card input[type=file]{padding:9px;background:#fff;min-width:0;font-size:12px}
@media(max-width:430px){.theme-options{grid-template-columns:1fr 1fr}.theme-option{font-size:10px;padding:8px}}

/* PetReturn 1.2: instalación para principiantes */
.install-tip{border:1px solid #cde0cf;border-radius:14px;background:#ecf6ed;padding:14px 16px;margin:0 0 18px;font-size:12px;line-height:1.55;color:#365f45}
.install-tip b{color:#24503a}.install-tip .tip-actions{gap:14px}.install-tip .tip-actions button{color:#205d42}
button.install-help{cursor:pointer;background:#fff;color:var(--forest);font-size:18px}
#install-dialog{max-width:min(550px,calc(100vw - 20px))}
#install-dialog .dlg-body{padding-bottom:20px}
.install-device{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin:13px 0 15px}
.install-device button{border:1px solid var(--line);border-radius:10px;background:#fff;color:var(--forest);font-weight:750;font-size:11px;padding:12px 2px;min-height:52px;cursor:pointer}
.install-device button.active{background:var(--mint);border:2px solid var(--forest)}
.install-stage{background:#f4f8f1;border:1px solid var(--line);border-radius:14px;padding:16px}
.install-stage h3{font-size:15px;margin:0 0 11px}.install-instructions{list-style:none;padding:0;margin:0;display:grid;gap:12px}
.install-instructions li{display:flex;gap:11px;align-items:start;font-size:13px;line-height:1.5}
.install-instructions .num{display:grid;place-items:center;width:26px;height:26px;background:#fff;border:1px solid var(--line);color:var(--forest);border-radius:50%;font-size:12px;font-weight:800;flex-shrink:0}
.install-complete{margin:13px 0 0;font-size:12px;color:#3c6c51;line-height:1.55}
.install-native{display:block;width:100%;text-align:center;margin-top:14px}
.install-alt{color:var(--muted);font-size:11px;line-height:1.55;margin:14px 0 0}
.install-success{background:#e9f4ed;border-radius:13px;padding:14px;font-size:13px;color:#20553b;line-height:1.5}
@media(max-width:430px){.install-device{gap:5px}.install-device button{font-size:10px;padding:10px 1px}.install-instructions li{font-size:12px}}
/* PetReturn 1.3 — instalación prioritaria, instrucciones plegadas */
.install-intro{margin-top:0;margin-bottom:15px!important}
.install-cta{width:100%;min-height:56px;font-size:15px;white-space:normal;box-shadow:0 6px 16px #174b3423}
.install-under-cta{font-size:11px;color:var(--muted);text-align:center;line-height:1.55;margin:10px 5px 17px}
.install-details{border:1px solid var(--line);border-radius:13px;background:#fff;overflow:hidden}
.install-details summary{list-style:none;cursor:pointer;display:flex;justify-content:space-between;gap:10px;align-items:center;padding:17px 15px;font-weight:750;font-size:12px;color:var(--forest)}
.install-details summary::-webkit-details-marker{display:none}
.install-details summary:focus-visible{outline:3px solid #82b89c;outline-offset:-3px}
.install-details[open] summary{border-bottom:1px solid var(--line);background:#fafcf9}
.install-chevron{font-size:19px;font-weight:500;transition:transform .2s}
.install-details[open] .install-chevron{transform:rotate(180deg)}
.install-details-content{padding:16px 13px}
.install-choice-label{font-size:12px;color:var(--muted);margin:0}
.install-safe{font-size:11px;line-height:1.55;color:var(--muted);margin:15px 0 0}
@media(max-width:430px){.install-details summary{font-size:11px;padding:15px 12px}}

/* v1.4 — edición y plantilla de mensajes WhatsApp */
.message-tokens{display:flex;gap:7px;flex-wrap:wrap;margin:-2px 0 14px}
.token-chip{border:1px solid var(--line);border-radius:99px;background:var(--mint);color:var(--forest);font-size:11px;font-weight:750;padding:8px 10px;cursor:pointer}
.token-chip:hover{filter:brightness(.96)}
#whatsapp-dialog .dlg-body{padding-bottom:20px}
#whatsapp-dialog #whatsapp-text{line-height:1.55;min-height:160px}
#whatsapp-for{margin:0 0 15px}
.whatsapp-footer{flex-wrap:wrap;gap:9px}
.whatsapp-footer .btn{flex:1;white-space:normal;text-align:center}
.btn.whatsapp.disabled{opacity:.5;pointer-events:none}
@media(max-width:520px){.whatsapp-footer .btn:first-child{flex:0 0 100%}.whatsapp-footer .btn{font-size:12px;padding:10px 8px}}

/* v1.5: actualizaciones seguras de la PWA */
#update-banner:empty{display:none}
.update-notice{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:11px;border:1px solid #bcdcc7;background:#edf8ef;border-radius:14px;padding:14px 16px;margin:0 0 18px;color:#24573d;font-size:13px;line-height:1.5}
.update-notice strong{display:block;font-size:14px}
.update-notice .btn{flex-shrink:0}
#updates-card p[role=status]{min-height:22px;line-height:1.6}
#updates-card button[hidden]{display:none!important}
@media(max-width:480px){.update-notice{align-items:stretch}.update-notice .btn{width:100%}}

/* Language selection — lightweight, usable on both desktop and phones */
.lang-control {display:flex;flex-direction:column;gap:5px;max-width:210px;color:var(--muted);font-weight:700;font-size:11px}
.lang-control select, #settings-language {width:100%;min-width:0;min-height:38px;border:1px solid var(--line);border-radius:10px;padding:5px 10px;background:#fff;color:var(--forest);font-size:12px;font-weight:700;cursor:pointer}
.desktop-language {margin:6px 12px 18px}
.mobile-language {margin-left:auto;width:58px;flex-shrink:0}
.mobile-language select {padding:5px 3px;min-height:35px;text-align:center}
@media(min-width:900px){.mobile-language{display:none}}
@media(max-width:899px){.desktop-language{display:none}}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}

/* 2.0 — Welcome only on first browser visit with zero pets. */
#welcome-dialog{border:none;padding:0;width:min(520px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;border-radius:24px;background:#fff;color:#273c33;box-shadow:0 22px 80px #0b211b44;}
#welcome-dialog::backdrop{background:rgba(13,38,30,.65);backdrop-filter:blur(3px);}
.welcome-inner{padding:30px 32px 27px;text-align:center;}
.welcome-mark{height:58px;width:58px;margin:0 auto 13px;background:#183f35;color:white;display:grid;place-items:center;font-size:30px;border-radius:18px;}
.welcome-eyebrow{margin:0 0 8px;letter-spacing:.16em;color:#7a9080;font-size:10px;font-weight:800;}
#welcome-dialog h2{font-size:28px;line-height:1.17;letter-spacing:-.8px;color:#173e33;margin:0 0 11px;}
.welcome-intro{margin:0 auto 18px;max-width:405px;line-height:1.55;color:#536e60;font-size:14px;}
.welcome-benefits{display:grid;gap:8px;padding:16px 17px;border-radius:16px;background:#f1f7f0;text-align:left;border:1px solid #e2ece0;}
.welcome-benefits div{display:flex;align-items:flex-start;gap:11px;font-size:12px;line-height:1.5;}
.welcome-benefits div span:first-child{font-size:17px;width:22px;flex-shrink:0;text-align:center;}
.welcome-caution{text-align:left;margin:14px 0;padding:12px 14px;background:#fff9ed;border:1px solid #efdfbb;border-radius:12px;color:#715c30;font-size:11px;line-height:1.58;}
.welcome-caution strong{font-size:15px;margin-right:3px;}
.welcome-actions{display:grid;gap:8px;margin:14px 0;}
.welcome-primary,.welcome-secondary{width:100%;min-height:48px;font-size:14px;font-weight:750;justify-content:center;}
.welcome-secondary{background:#fff!important;border:1px solid #d6e1d7!important;color:#1b4837!important;}
.welcome-already{border:none;background:transparent;text-decoration:underline;color:#5c7064;cursor:pointer;font-size:12px;font-weight:700;min-height:34px;}
.welcome-footnote{margin:7px 0 0;color:#809087;font-size:10px;line-height:1.55;}
@media(max-width:560px){.welcome-inner{padding:24px 20px 18px;}#welcome-dialog h2{font-size:24px}.welcome-intro{font-size:13px;margin-bottom:14px}.welcome-benefits{padding:12px 14px}.welcome-caution{font-size:11px;margin:11px 0}.welcome-actions{margin:9px 0;gap:6px}.welcome-mark{width:50px;height:50px;font-size:26px}}
