
:root{--navy:#18364b;--teal:#168c91;--teal2:#20a5aa;--pale:#eff6fa;--pale2:#f7fbfd;--line:#d8e7ee;--muted:#668092;--green:#1eaa72;--red:#dc5b5b;--amber:#f2a33a}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--navy);background:#eaf5fa}
body{display:flex;justify-content:center}.app-shell{width:100%;min-height:100vh}.screen{width:100%;max-width:430px;min-height:100vh;margin:auto;background:linear-gradient(#f8fcfe,#eef7fb);position:relative;padding-bottom:84px;box-shadow:0 0 35px #15364b22}
.content{padding:14px 16px 24px}.topbar{height:68px;padding:14px 18px;display:flex;align-items:center;justify-content:space-between;background:#f8fcfe}.brand{display:flex;gap:7px;align-items:center;color:var(--navy);text-decoration:none;font-weight:800;font-size:18px}.horsemark{font-size:28px;color:var(--teal);transform:rotate(-20deg)}.avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#dbeaf1;color:var(--navy);font-weight:800;text-decoration:none;font-size:12px}.avatar.big{width:54px;height:54px;font-size:16px}
h1{font-size:26px;margin:6px 0}h2{font-size:20px;margin:0}h3{font-size:15px;margin:6px 0 12px}p{margin:5px 0;color:#496779;font-size:14px;line-height:1.4}a{color:inherit}.eyebrow{font-size:10px;letter-spacing:.12em;font-weight:700;color:#78909e}.row{display:flex;align-items:center;justify-content:space-between;gap:10px}.grow{flex:1}.teal{color:var(--teal)}
.welcome{display:flex;justify-content:space-between;align-items:center;margin:3px 0 14px}.sun{font-size:30px;color:#f4b122}
.horse-card,.boundary-card{display:flex;gap:12px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:16px;padding:12px;margin:10px 0;text-decoration:none;box-shadow:0 5px 16px #18364b0c}.horse-photo{width:66px;height:76px;flex:none;border-radius:12px;display:grid;place-items:center;font-weight:900;font-size:22px;color:#fff;background:linear-gradient(145deg,#6b4d35,#b9875e);position:relative;overflow:hidden}.horse-photo:after{content:"♞";font-size:44px;color:#ffffffdd}.horse-photo.secret{background:linear-gradient(145deg,#4a2d20,#a46b43)}.horse-photo.pixie{background:linear-gradient(145deg,#aab8bd,#edf2f3);color:var(--navy)}.horse-photo.pixie:after{color:#24455a}.horse-photo.large{width:110px;height:110px;border-radius:50%}.horse-main{min-width:0;flex:1}.horse-main h2{font-size:19px}.chev{font-size:26px}.ok{color:var(--green)!important;font-size:12px}.updated{font-size:11px}.metrics{display:flex;gap:18px;margin:8px 0}.metrics span{display:grid;grid-template-columns:auto auto;column-gap:5px;font-size:12px}.metrics small{grid-column:2;color:var(--muted);font-size:9px}
.map-preview{display:block;background:#fff;border-radius:16px;border:1px solid var(--line);overflow:hidden;text-decoration:none;margin:12px 0}.map-art,.map-full,.history-map,.draw-map,.alert-map{background-color:#b7cfa9;background-image:linear-gradient(32deg,#8fb78055 25%,transparent 25%),linear-gradient(145deg,#d7c99f66 30%,transparent 30%),linear-gradient(70deg,transparent 65%,#7da07066 65%);position:relative;overflow:hidden}.map-art{height:170px}.field{position:absolute;border:3px dashed #1ba0a4;background:#2ea9a526}.f1{width:220px;height:115px;left:70px;top:25px;transform:rotate(6deg);border-radius:35%}.f2{width:130px;height:90px;right:-20px;bottom:-15px}.pin{position:absolute;left:48%;top:45%;width:42px;height:42px;border-radius:50%;display:grid;place-items:center;background:#fff;border:4px solid var(--teal);font-size:24px}.map-copy{display:grid;grid-template-columns:1fr auto;padding:12px 14px}.map-copy small{grid-column:1;color:var(--green)}
.primary,.secondary,.danger-button{min-height:48px;border-radius:12px;display:flex;align-items:center;justify-content:center;text-decoration:none;font-weight:750;font-size:14px;margin:10px 0;border:0;cursor:pointer}.primary{background:linear-gradient(90deg,var(--teal),var(--teal2));color:#fff}.secondary{background:#fff;border:1px solid #9bc8d4;color:var(--teal)}.danger-button{width:100%;background:#fff4f4;border:1px solid #f0c5c5;color:#cf4444}.button{width:100%;font-family:inherit}.text-link{display:block;text-align:center;color:var(--teal);font-weight:650;margin:12px 0}
.bottom-nav{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(430px,100%);height:72px;background:#fff;border-top:1px solid var(--line);display:grid;grid-template-columns:repeat(4,1fr);z-index:20;padding-bottom:max(5px,env(safe-area-inset-bottom))}.bottom-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;text-decoration:none;color:#5f7788;font-size:22px}.bottom-nav small{font-size:10px}body[data-active=home] .nav-home,body[data-active=map] .nav-map,body[data-active=history] .nav-history,body[data-active=alerts] .nav-alerts{color:var(--teal);font-weight:800}
.page-head{min-height:50px;display:grid;grid-template-columns:44px 1fr 44px;align-items:center;text-align:center;margin-bottom:10px}.page-head h1{font-size:18px}.page-head>a{font-size:26px;text-decoration:none}.page-head>a:last-child{text-align:right}.hero-horse{height:230px;border-radius:18px;background:linear-gradient(0deg,#18364b88,transparent 55%),linear-gradient(135deg,#92b178,#d8c6a1);position:relative;overflow:hidden}.hero-horse:after{content:"♞";position:absolute;font-size:180px;right:65px;top:15px;color:#392c23}.hero-label{position:absolute;z-index:2;left:16px;bottom:14px;color:#fff}.hero-label p{color:#fff}
.status-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:12px 0}.status-grid>*{background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px 7px;text-decoration:none;text-align:center;display:flex;flex-direction:column;gap:4px}.status-grid span{color:var(--teal);font-size:20px}.status-grid b{font-size:15px}.status-grid small{font-size:9px;color:var(--muted)}
.shortcut-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.shortcut-grid a{background:#e8f4f7;border-radius:12px;text-align:center;padding:12px;text-decoration:none;color:var(--navy);font-size:22px}.shortcut-grid small{display:block;font-size:10px;margin-top:4px}
.card,.info-card,.warning-card{background:#fff;border:1px solid var(--line);border-radius:15px;padding:14px;margin:12px 0}.data-row{display:flex;justify-content:space-between;gap:15px;padding:11px 0;border-bottom:1px solid #edf3f6;font-size:12px}.data-row:last-child{border:0}.data-row span{color:#60798a}.data-row b{text-align:right}.info-card{background:#eaf6f8}.warning-card{background:#fff6e8;border-color:#f3d7a6}.warning-card b{color:#b56a10}.center{text-align:center}
.segmented{display:grid;grid-template-columns:1fr 1fr;background:#dfeef4;border-radius:12px;padding:3px;margin:10px 0}.segmented.three{grid-template-columns:repeat(3,1fr)}.segmented button,.segmented a{border:0;background:transparent;border-radius:10px;padding:10px;text-decoration:none;text-align:center;color:var(--navy);font:inherit;font-size:12px}.segmented .selected{background:var(--teal);color:#fff;font-weight:700}
.temperature-main{padding:12px 0}.temp-big{font-size:46px;font-weight:800;letter-spacing:-.04em}.chart{height:150px;border-radius:12px;background:linear-gradient(#fff,#eaf6f8);margin:12px 0;padding:12px}.chart svg{width:100%;height:100%;overflow:visible}.chart polyline{fill:none;stroke:var(--teal);stroke-width:4;stroke-linecap:round;stroke-linejoin:round}.minmax{display:grid;grid-template-columns:1fr 1fr;gap:10px}.minmax span{background:#fff;border-radius:12px;padding:12px;color:var(--muted);font-size:11px}.minmax b{display:block;color:var(--navy);font-size:18px}
.mini-horse,.profile{display:flex;align-items:center;gap:10px}.mini-horse .horse-photo{width:48px;height:48px}.mini-horse .horse-photo:after{font-size:30px}.mini-horse small,.profile small{display:block;color:var(--muted);font-size:11px}
label{display:block;color:#496779;font-size:11px;font-weight:650;margin:10px 0}input,select,textarea,.search{width:100%;min-height:44px;border:1px solid #cfe1e9;background:#fff;border-radius:9px;padding:10px 12px;color:var(--navy);font:inherit;margin-top:5px}textarea{min-height:80px;resize:vertical}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.map-full{height:calc(100vh - 72px);min-height:650px}.map-controls{position:absolute;left:14px;right:14px;top:16px;display:flex;justify-content:space-between;z-index:3}.map-controls button{background:#fff;border:0;border-radius:22px;padding:12px 15px;color:var(--navy);box-shadow:0 4px 15px #0002}.geofence{position:absolute;left:18%;top:25%;width:65%;height:42%;border:4px dashed var(--teal);background:#1aa0a31f;border-radius:30% 45% 25% 35%;transform:rotate(-7deg)}.map-pin{position:absolute;width:52px;height:52px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);background:#fff;border:4px solid var(--teal);display:grid;place-items:center;text-decoration:none;font-size:24px}.map-pin>*{transform:rotate(45deg)}.map-pin small{position:absolute;left:40px;top:40px;background:#fff;border-radius:8px;padding:3px 6px;font-size:10px}.secret-pin{left:45%;top:40%}.pixie-pin{left:68%;top:58%}.map-location-card{position:absolute;left:12px;right:12px;bottom:18px;background:#fff;border-radius:18px;padding:12px;display:grid;grid-template-columns:58px 1fr 30px;gap:10px;align-items:center;box-shadow:0 8px 25px #18364b33}.map-location-card .horse-photo{width:56px;height:56px}.map-location-card .horse-photo:after{font-size:35px}.map-location-card small{display:block;font-size:10px;margin-top:3px}.map-location-card>a{font-size:30px;text-decoration:none}
.horse-select{display:grid;grid-template-columns:42px 1fr 24px;align-items:center;gap:8px;background:#fff;border:1px solid var(--line);padding:8px;border-radius:12px}.horse-select .horse-photo{width:38px;height:38px;border-radius:50%}.horse-select .horse-photo:after{font-size:25px}.datebar{display:flex;align-items:center;justify-content:space-between;padding:10px 0;font-size:12px}.datebar button{border:0;background:transparent;font-size:22px;color:var(--navy)}.history-map{height:300px;border-radius:14px}.route{position:absolute;width:70%;height:55%;left:15%;top:20%;border:5px dashed #fff;border-top-color:var(--teal);border-right-color:var(--teal);border-radius:45% 35% 50% 30%;transform:rotate(8deg)}.route-pin{position:absolute;left:45%;top:45%;font-size:34px;color:var(--teal)}.distance{font-size:28px;font-weight:800}.timeline{display:flex;gap:10px;align-items:center}.timeline input{margin:0}.timeline button{border:0;width:40px;height:40px;border-radius:50%;background:var(--teal);color:#fff}
.calendar .week,.calendar .days{display:grid;grid-template-columns:repeat(7,1fr);text-align:center;gap:4px}.calendar .week{font-size:10px;color:var(--muted);margin:12px 0}.calendar .days span{padding:9px 0;border-radius:50%;font-size:12px}.calendar .selected-day{background:var(--teal);color:#fff}
.round-add{width:38px;height:38px!important;border-radius:50%;background:var(--teal);color:#fff;display:grid;place-items:center;font-size:24px!important}.boundary-thumb{width:90px;height:80px;border-radius:10px;background:#a7c497;position:relative}.boundary-thumb:after{content:"";position:absolute;inset:13px;border:3px solid var(--teal);border-radius:30%}.boundary-thumb.yard:after{inset:20px 12px 12px 20px}.boundary-card{display:grid;grid-template-columns:90px 1fr 20px}.boundary-card small{display:block;font-size:10px;color:var(--muted);margin:4px 0}.add-card{display:block;text-align:center;border:1px dashed #9fcbd6;background:#eef8fb;border-radius:15px;padding:20px;text-decoration:none}.add-card b{font-size:28px;color:var(--teal)}
.draw-map{position:absolute;inset:0 0 160px;z-index:0}.draw-map svg{width:100%;height:100%}.draw-map polygon{fill:#168c9133;stroke:#19a4a9;stroke-width:5}.draw-map circle{fill:#fff;stroke:#168c91;stroke-width:3}.page-head.overlay{position:relative;z-index:2;background:#ffffffdd;border-radius:14px}.editor-panel{position:absolute;z-index:3;left:0;right:0;bottom:0;background:#fff;padding:15px;border-radius:22px 22px 0 0}.screen:has(.draw-map){padding-bottom:0}.screen:has(.draw-map) .content{min-height:100vh}
.checkrow,.switchrow{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #edf3f6}.checkrow input,.switchrow input,.filter input{width:42px;height:24px;accent-color:var(--teal);margin:0}.switchrow span{display:block}.switchrow small{display:block;color:var(--muted);font-weight:400;margin-top:3px}
.filter{background:#fff;border:1px solid var(--line);border-radius:12px;padding:12px;display:flex;justify-content:space-between;align-items:center}.alert-card{display:grid;grid-template-columns:38px 1fr auto;gap:10px;align-items:start;background:#fff;border:1px solid var(--line);border-radius:14px;padding:13px;margin:10px 0;text-decoration:none}.alert-card p{font-size:11px}.alert-card time{font-size:10px;color:var(--muted)}.alert-icon{width:32px;height:32px;border-radius:50%;display:grid;place-items:center;background:#e7f6fa;color:var(--teal);font-weight:900}.alert-card.danger .alert-icon{background:#fde8e8;color:var(--red)}.alert-card.warn .alert-icon{background:#fff0da;color:#d37c10}.alert-banner{background:#fde8e8;border-radius:14px;padding:14px;color:#a83737}.alert-banner small{display:block;margin-top:5px}.alert-map{height:300px;border-radius:14px;margin:12px 0}.geofence.small{top:25%;left:15%;width:60%;height:50%}.outside-pin{position:absolute;right:12%;top:28%;font-size:34px;color:var(--red)}
.profile{padding:10px 0 18px}.settings-list{background:#fff;border:1px solid var(--line);border-radius:14px;overflow:hidden;margin:10px 0}.settings-list a{min-height:52px;padding:11px 14px;display:grid;grid-template-columns:28px 1fr auto;align-items:center;text-decoration:none;border-bottom:1px solid #edf3f6;gap:7px}.settings-list a:last-child{border:0}.settings-list small{display:block;color:var(--muted);font-size:10px}
.edit-photo{display:flex;justify-content:center;position:relative;margin:15px}.edit-photo button{position:absolute;bottom:0;left:58%;border:0;border-radius:50%;width:38px;height:38px;background:var(--teal);color:#fff}.tracker-card{display:grid;grid-template-columns:28px 62px 1fr;gap:10px;align-items:center;background:#fff;border:1px solid var(--line);border-radius:14px;padding:12px}.tracker-card.selected{border:2px solid var(--teal)}.tracker-card input{width:20px;margin:0;accent-color:var(--teal)}.tracker-card small{display:block;margin-top:4px}.device{font-size:38px;color:#394a53}.device-hero{display:flex;align-items:center;gap:18px;background:#fff;border-radius:16px;padding:18px}.big-device{font-size:70px}.device-hero h2{display:flex;gap:8px}.device-hero em{font-size:10px;font-style:normal;color:var(--green);background:#e5f7ef;padding:5px;border-radius:10px}
.search{margin:0 0 12px}.version{text-align:center;font-size:10px;color:var(--muted)}
.offline-banner{margin:-14px -16px 16px;background:#ffe3a2;padding:12px 16px;display:grid;grid-template-columns:24px 1fr}.offline-banner small{grid-column:2}.signin-hero{height:340px;margin:-14px -16px 0;background:linear-gradient(#e9f7fb88,#18364b22),linear-gradient(145deg,#bad3c1,#d9c69f);display:flex;flex-direction:column;align-items:center;padding-top:38px}.large-brand{font-size:30px;background:#ffffffcc;padding:10px 18px;border-radius:18px}.signin-hero h2{background:#ffffffcc;padding:6px 12px;border-radius:10px;font-size:15px}.signin-panel{margin:-38px 0 0;background:#fff;border-radius:22px;padding:18px;position:relative}.signin-panel hr{border:0;border-top:1px solid var(--line);margin:16px 0}.signin-panel>p{text-align:center}.empty-state{max-width:360px;margin:70px auto;text-align:center}.empty-state.first{margin-top:120px}.big-icon,.horse-outline{font-size:68px;color:var(--teal);margin:20px}.bell{width:110px;height:110px;border-radius:50%;background:#e6f4f8;display:grid;place-items:center;margin:20px auto}.missing-temp{position:relative}.missing-temp .pill{position:absolute;right:14px;top:50px;background:#e7eef2;border-radius:12px;padding:5px 8px;font-size:9px}.missing-temp>small{display:block;color:var(--muted);margin-top:8px}.small-chart{height:120px}
@media(min-width:800px){body{padding:20px 0}.screen{min-height:calc(100vh - 40px);border-radius:22px;overflow:hidden}.bottom-nav{bottom:20px;border-radius:0 0 22px 22px}.map-full{min-height:calc(100vh - 112px)}}

/* Live Traccar + screenshot alignment */
.leaflet-mini{height:170px;background:#cfe0d1}.leaflet-live{position:absolute;inset:0;z-index:1}
.real-map-wrap .map-controls{z-index:500}.real-map-wrap .map-location-card{z-index:500}
.map-content{padding:0}.real-map-wrap{border-radius:0}
.equii-map-marker{background:transparent;border:0;text-align:center}
.equii-map-marker>div{width:42px;height:42px;border-radius:50% 50% 50% 0;transform:rotate(-45deg);display:grid;place-items:center;background:#fff;border:4px solid var(--teal);font-size:22px;box-shadow:0 4px 10px #0003}
.equii-map-marker>div.offline{border-color:#849ba8}.equii-map-marker>div::first-letter{transform:rotate(45deg)}
.equii-map-marker small{display:inline-block;background:#fff;padding:3px 7px;border-radius:8px;box-shadow:0 2px 8px #0002;font-weight:750;white-space:nowrap;margin-top:2px}
.raw-attributes pre{white-space:pre-wrap;word-break:break-word;font-size:10px;color:#466171;max-height:240px;overflow:auto;margin:0}
.offline-text{color:#c87923!important;font-size:12px}.login-error{color:#c33;text-align:center;font-weight:700}
.live-error:before{content:"Traccar connection unavailable";position:fixed;z-index:9999;left:50%;transform:translateX(-50%);top:6px;background:#ffe1a8;color:#7a4a00;border-radius:12px;padding:7px 12px;font-size:11px;font-weight:750}


/* EQUIITRACK_DIAGNOSTICS_V1 */
.diagnostics-note{border-left:4px solid var(--teal)}
.diagnostic-actions{align-items:stretch}.diagnostic-actions .button{margin:8px 0}.diagnostic-actions .secondary{width:92px;flex:none}
.diagnostic-list{display:grid;gap:10px;margin:12px 0}
.diagnostic-card{background:#fff;border:1px solid var(--line);border-radius:15px;padding:14px;box-shadow:0 5px 16px #18364b0c}
.diagnostic-card h3{margin:0 0 4px;font-size:16px}.diagnostic-card code{font-size:11px;color:var(--teal);background:#eaf6f8;padding:3px 7px;border-radius:7px}
.diagnostic-head{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.diag-state{font-size:10px;font-weight:800;border-radius:999px;padding:5px 8px;white-space:nowrap}
.diag-state.idle{background:#edf3f6;color:#627b8b}.diag-state.working{background:#e8f5f7;color:#087d83}
.diag-state.ok{background:#e6f7ef;color:#13865c}.diag-state.timeout{background:#fff1d8;color:#a96b0b}.diag-state.error{background:#fde8e8;color:#b94242}
.diag-result{white-space:pre-wrap;word-break:break-word;background:#f5fafc;border:1px solid #e0edf2;border-radius:10px;padding:10px;min-height:48px;max-height:230px;overflow:auto;color:#264b60;font-size:11px;line-height:1.45}
.diagnostic-card .diag-one{min-height:38px;margin-bottom:0;font-size:12px}

/* EQUIITRACK_V4_LIVE_DATA */
.temperature-chart-card{position:relative;overflow:hidden}.temperature-chart-card svg{display:block;position:relative;z-index:2}.temperature-chart-card .chart-grid{stroke:#d9e9ef;stroke-width:1;stroke-dasharray:4 5}.chart-empty{position:absolute;inset:0;display:grid;place-items:center;color:var(--muted);font-size:11px;text-align:center;padding:22px;z-index:1}.chart-empty[hidden]{display:none}.history-summary{font-size:10px;color:var(--muted);margin-top:8px}.advanced-card summary{cursor:pointer;font-weight:750;font-size:12px;color:#496779}.advanced-card[open] summary{margin-bottom:10px}.compact-label{margin-top:2px}.leaflet-history{height:300px;background:#cfe0d1}.history-stats{display:grid;grid-template-columns:1fr 1fr;column-gap:16px}.history-stats .history-summary{grid-column:1/-1}.small-distance{font-size:22px}.datebar button:disabled{opacity:.25}.compact-empty{margin:20px auto 30px}.tracker-offline{color:#c87923!important;background:#fff0da!important}.horse-photo{font-size:0}.horse-photo::before{content:attr(data-initial);font-size:22px;position:absolute;z-index:2}.edit-photo .horse-photo{font-size:22px}.edit-photo .horse-photo:after{opacity:.65}

/* EQUIITRACK_V5_BOUNDARIES */
.boundary-intro{margin-bottom:12px}.boundary-live-map{height:330px;border-radius:16px;background:#cfe0d1;margin-bottom:12px;overflow:hidden}
.boundary-detail-map{height:360px;border-radius:16px;background:#cfe0d1;margin-bottom:12px;overflow:hidden}
.boundary-form{display:grid;gap:12px}.boundary-form label>input{margin-top:5px}.form-help{font-size:10px;color:var(--muted);margin:4px 0 8px}
.boundary-horse-list{border-top:1px solid var(--line)}.boundary-horse-list .checkrow input{width:22px;height:22px}
.danger-button{color:#b94242;border-color:#e8bcbc!important}.boundary-card{margin-bottom:10px}
