/* Scoped to the mobile farm dialog. Does not restyle the rest of the game. */
#panel.farm-panel{width:min(100%,740px);max-width:740px;height:100dvh;max-height:100dvh;margin:0 auto;padding:0;border:0;border-radius:0;background:#f2f5ee;color:#23382f}
#panel.farm-panel .panel-head{background:#fbfdf7;border-bottom:1px solid #d6e2d8;min-height:48px;padding:4px 12px;padding-top:max(4px,env(safe-area-inset-top));color:#234d43}
#panel.farm-panel #panel-title{font-size:16px;letter-spacing:.06em}
#panel.farm-panel .icon-button{color:#234d43;background:#eef4ec;border:0;min-width:44px;min-height:44px}
#panel.farm-panel #panel-body{padding:0;max-width:none;overscroll-behavior:contain;scroll-padding-bottom:90px;overflow-x:hidden}
.fm-shell{--fm-ink:#234138;--fm-green:#286351;--fm-sky:#3d7890;--fm-edge:#d9e4d9;--fm-muted:#5e7167;line-height:1.7;font-size:16px;background:linear-gradient(#e9f4f6 0,#f5f7ef 280px,#f5f7ef);min-height:100%;position:relative;isolation:isolate;display:flex;flex-direction:column}
.fm-shell *{box-sizing:border-box;min-width:0}
.fm-shell h2,.fm-shell h3,.fm-shell p{margin:0}
.fm-shell h3{font-size:18px;color:var(--fm-ink);line-height:1.5;margin-bottom:12px}
.fm-shell p+p{margin-top:9px}
.fm-shell small{font-size:14px;line-height:1.5;color:var(--fm-muted)}
.fm-header{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:18px 18px 10px;background:linear-gradient(110deg,#dceff2,#edf5ed)}
.fm-header small{font-size:11px;letter-spacing:.22em;font-weight:700;color:#39736b}
.fm-header h2{font-family:'Hiragino Mincho ProN','Yu Mincho',serif;font-weight:700;font-size:27px;letter-spacing:.04em;margin:1px 0}
.fm-header>div:last-child{text-align:right;font-size:14px;display:flex;flex-direction:column;gap:3px}
.fm-header>div:last-child strong{font-size:18px;color:#254e41;font-variant-numeric:tabular-nums}
.fm-mode-strip{padding:8px 18px 10px;display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:12px;color:var(--fm-muted)}
.fm-tag{display:inline-flex;background:#e6efde;color:#35513f;border:1px solid #d3e1c8;border-radius:5px;padding:2px 7px;font-size:12px;font-weight:650;line-height:1.6}
.fm-content{padding:0 14px 24px;flex:1}
.fm-kpis{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:4px 0 12px}
.fm-kpis article{border:1px solid #d4e0d4;border-radius:10px;padding:11px 12px;background:#ffffffed;box-shadow:0 2px 4px #26412e05;display:flex;flex-direction:column;gap:3px}
.fm-kpis small{font-size:13px}
.fm-kpis strong{font-size:22px;font-variant-numeric:tabular-nums;line-height:1.5;color:#245640}
.fm-kpis strong span{font-size:14px;font-weight:500;color:#6e8074}
.fm-scene{position:relative;aspect-ratio:1.67;overflow:hidden;border-radius:12px;border:1px solid #bfd3c0;margin:0 0 12px;background:#d3e7d2}
.fm-scene>img{width:100%;height:100%;object-fit:cover;display:block}
.fm-scene::after{content:'';position:absolute;inset:0;background:linear-gradient(#072c361f,transparent 40%,#0e321d82);pointer-events:none}
.fm-scene-title{position:absolute;top:14px;left:14px;color:white;text-shadow:0 1px 5px #1b3f47;z-index:1;display:flex;flex-direction:column}
.fm-scene-title span{font-size:10px;letter-spacing:.2em;font-weight:700}
.fm-scene-title strong{font-size:22px;font-family:'Hiragino Mincho ProN','Yu Mincho',serif;letter-spacing:.08em}
.fm-scene-bottom{position:absolute;z-index:1;bottom:10px;left:12px;right:12px;display:flex;justify-content:space-between;align-items:center;gap:8px}
.fm-shell button.fm-scene-link{color:white;background:#1e4f3bcc;border-color:#ffffff70;font-size:14px;min-height:44px;padding:7px 10px}
.fm-mugi{display:grid;grid-template-columns:79px 1fr;gap:12px;background:#fffef8;border:1px solid #dfdac6;border-radius:12px;padding:12px;margin:12px 0;align-items:center}
.fm-mugi-portrait{width:79px;height:105px;overflow:hidden;border-radius:9px;background:linear-gradient(#d0e4cd,#f5efd8)}
.fm-mugi-portrait img{width:100%;height:100%;object-fit:cover;object-position:50% 8%}
.fm-mugi p{font-size:15px;color:#324536;line-height:1.65;margin:3px 0 4px}
.fm-overline{font-size:12px;letter-spacing:.09em;font-weight:700;color:#6b774d}
.fm-card{padding:17px 15px;border:1px solid var(--fm-edge);border-radius:12px;background:#ffffffed;margin:12px 0;box-shadow:0 2px 5px #293c2404;overflow-wrap:anywhere}
.fm-card .fm-note{color:var(--fm-muted);font-size:14px;margin-top:10px}
.fm-activation{border-color:#afc8c4;background:#edf5f3}
.fm-shell .fm-note{font-size:14px;color:var(--fm-muted);line-height:1.65}
.fm-scope-note{padding:12px 5px;border-top:1px solid var(--fm-edge);margin-top:18px}
.fm-shell button.fm-button{font:inherit;color:var(--fm-ink);border:1px solid #c6d7cb;border-radius:8px;background:#f8fbf5;min-height:48px;box-shadow:none;padding:10px 13px;line-height:1.45;text-align:center;touch-action:manipulation;white-space:normal;cursor:pointer;transition:background .12s ease;max-width:100%;overflow-wrap:anywhere;word-break:normal}
.fm-shell button.fm-button:hover:not(:disabled){background:#e8f0df}
.fm-shell button.fm-button:focus-visible,.fm-shell input:focus-visible,.fm-shell select:focus-visible{outline:3px solid #d39435;outline-offset:2px}
.fm-shell button.fm-primary{background:#3b7786;border-color:#316b7b;color:#fff;font-weight:650}
.fm-shell button.fm-primary:hover:not(:disabled){background:#2e6371}
.fm-shell button.fm-subtle{background:transparent;border-color:#d8e1d9;font-size:14px}
.fm-shell button:disabled{opacity:.55;cursor:not-allowed;filter:none}
.fm-shell button.fm-small{padding:9px 10px;font-size:14px;flex-shrink:0}
.fm-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.fm-actions>*{flex:1 1 130px}
.fm-wide{width:100%;margin-top:12px}
.fm-shell button.fm-back{border:0;background:transparent;text-align:left;font-size:14px;padding-left:0;min-height:44px}
.fm-entry-grid{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:13px 0}
.fm-shell button.fm-entry{padding:14px 12px;text-align:left;background:#fffef9;border-color:#d6e2d2;display:flex;flex-direction:column;gap:4px;min-height:98px;position:relative}
.fm-entry-icon{color:#3d8069;font-size:24px;height:26px;line-height:1}
.fm-entry strong{font-size:16px}.fm-entry small{font-size:12px;line-height:1.5;color:#64746b}
.fm-topic{padding:8px 0 8px 15px;border-bottom:1px solid #e7ede4;font-size:15px;position:relative}
.fm-topic::before{content:'•';position:absolute;left:0;color:#6e9a77}
.fm-nav{position:sticky;z-index:5;bottom:0;display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:0;background:#fafcf7f5;backdrop-filter:blur(10px);border-top:1px solid #cbd9ce;box-shadow:0 -3px 14px #1831230a;padding:4px 7px max(5px,env(safe-area-inset-bottom))}
.fm-shell .fm-nav button{display:flex;flex-direction:column;align-items:center;gap:2px;background:none;border:0;border-radius:6px;font-size:12px;color:#708278;padding:5px 2px;min-height:55px;font-weight:650}
.fm-nav button span{font-size:23px;line-height:1.1}
.fm-shell .fm-nav .fm-selected{color:#2b6d7b;background:#e4eff0}
.fm-banner{width:100%;height:185px;object-fit:cover;border-radius:12px;border:1px solid #c8d9c6;display:block}
.fm-title-row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:12px 0}
.fm-level{font-size:32px;line-height:1.3;color:#234b3e}.fm-level small{font-size:17px;font-weight:400}
.fm-inline-stats{display:flex;flex-wrap:wrap;align-items:center;gap:7px;margin:10px 0}
.fm-meter{display:grid;grid-template-columns:1fr auto;gap:5px;font-size:14px;margin:12px 0}
.fm-meter strong{font-variant-numeric:tabular-nums;color:#356755}
.fm-meter>div{grid-column:1/-1;height:7px;background:#e6eee3;border-radius:4px;overflow:hidden}
.fm-meter i{display:block;height:100%;background:linear-gradient(90deg,#3b7e81,#76a66f);border-radius:4px}
.fm-comparison{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-bottom:13px}
.fm-comparison>div{border:1px solid #e0e7dc;border-radius:8px;padding:10px;background:#f8faf3}
.fm-comparison small,.fm-comparison strong{display:block}
.fm-comparison strong{font-size:17px;margin-top:3px}
.fm-equipment-card{display:flex;align-items:center;gap:11px;background:#fffef9;border:1px solid var(--fm-edge);padding:14px 11px;border-radius:11px;margin:10px 0}
.fm-equipment-icon{background:#e5eedb;color:#498166;width:43px;height:48px;display:grid;place-items:center;border-radius:9px;font-size:26px;flex-shrink:0}
.fm-equipment-icon.fm-empty{background:#edf0ec;color:#929f95}
.fm-equipment-info{flex:1}
.fm-equipment-info h3{font-size:16px;margin:0 0 3px}
.fm-equipment-info p{font-size:14px;color:#367052}
.fm-equipment-info small{display:block;font-size:12px;line-height:1.7;color:#697971}
.fm-detail-symbol{display:inline-grid;place-items:center;width:44px;height:44px;margin-right:10px;background:#e8efdf;border-radius:8px;font-size:28px;vertical-align:middle}
.fm-lead{font-size:17px;color:#3c6455}
.fm-effect,.fm-detail-cost{display:flex;gap:12px;justify-content:space-between;align-items:baseline;padding:9px 0;border-bottom:1px solid #e7ece3;font-size:15px}
.fm-effect strong{letter-spacing:.14em;color:#518878}.fm-detail-cost strong{text-align:right;flex-shrink:0;font-variant-numeric:tabular-nums}
.fm-warning{background:#fff2d7;border:1px solid #e8c991;border-radius:7px;padding:10px;font-size:14px;color:#785123;margin:12px 0!important}
.fm-shell form{margin:12px 0;display:flex;flex-direction:column;gap:9px}
.fm-shell form label{display:flex;flex-direction:column;font-size:14px;color:#516f5d;gap:5px}
.fm-shell select,.fm-shell input{font:inherit;font-size:16px;background:#fbfcf9;color:#233e31;width:100%;min-height:48px;padding:9px;border:1px solid #c8d9c6;border-radius:7px}
.fm-shell form button{background:#367887;color:white;border:0;border-radius:8px;font:inherit;min-height:48px;padding:10px}
.fm-transaction{padding:12px 0;border-bottom:1px solid #e5eadd}
.fm-transaction p{font-size:15px;margin:3px 0;overflow-wrap:anywhere}.fm-transaction strong{display:block;text-align:right;font-size:16px;font-variant-numeric:tabular-nums}
.fm-negative{color:#8b4f3a}.fm-positive{color:#28744d}
.fm-map-scene{aspect-ratio:.91}.fm-map-scene>img{object-position:50%;image-rendering:auto}
.fm-map-pins{position:absolute;inset:86px 14px 16px;z-index:2;display:grid;grid-template-columns:1fr 1fr;align-content:space-around;gap:48px 17px}
.fm-shell .fm-map-pins button{background:#fffdf2e8;border:2px solid #87a88c;box-shadow:0 2px 7px #23362230;font-size:15px;font-weight:600}
.fm-shell .final-section{margin-top:15px}
.fm-reduced *{animation:none!important;transition:none!important;backdrop-filter:none!important}
@media(prefers-reduced-motion:reduce){.fm-shell *{animation:none!important;transition:none!important}}
@media(max-width:359px){.fm-header{padding:13px 12px 9px;gap:8px}.fm-header h2{font-size:23px}.fm-header>div:last-child{font-size:12px}.fm-header>div:last-child strong{font-size:16px}.fm-content{padding:0 10px 20px}.fm-mode-strip{padding:7px 12px;font-size:11px}.fm-kpis strong{font-size:20px}.fm-mugi{grid-template-columns:65px 1fr;gap:9px;padding:10px}.fm-mugi-portrait{width:65px;height:100px}.fm-equipment-card{gap:8px;padding:12px 9px}.fm-equipment-icon{width:34px;font-size:23px}.fm-comparison{gap:7px}}
@media(min-width:600px){.fm-content{padding:0 24px 28px}.fm-header{padding:22px 25px 13px}.fm-mode-strip{padding:10px 25px}.fm-kpis{grid-template-columns:repeat(4,1fr)}.fm-scene{aspect-ratio:2.1}.fm-map-scene{aspect-ratio:1.6}.fm-mugi p{font-size:16px}.fm-banner{height:235px}}

#panel.farm-panel .panel-head{gap:12px}
#panel.farm-panel #panel-title{margin:0}
#panel.farm-panel button:focus-visible{outline:3px solid #477f6c;outline-offset:2px}
/* Stage 2: juvenile cards use the same portrait-friendly components. */
.yt-horse-head{display:grid;grid-template-columns:78px minmax(0,1fr);gap:12px;align-items:center;margin:12px 0}
.yt-horse-head img{display:block;width:78px;height:90px;object-fit:cover;border-radius:9px;background:#eaf1e0}
.yt-horse-head p{margin:4px 0}.yt-location{font-weight:650;color:#2b6570;padding:8px 0}
.yt-pages{display:flex;align-items:center;justify-content:center;flex:0 0 auto!important;font-size:14px}
.yt-name{overflow-wrap:anywhere}.fm-shell .yt-horse-head>div{min-width:0}
@media(max-width:359px){.yt-horse-head{grid-template-columns:65px minmax(0,1fr);gap:9px}.yt-horse-head img{width:65px;height:80px}}
/* v7.1.128 Shiomi Farm diorama home */
.fm-farmyard{aspect-ratio:.72;min-height:560px;border-radius:10px;background:#cbdcbf;margin-top:2px;box-shadow:0 4px 14px #28433318}
.fm-farmyard>img{object-position:center center;filter:saturate(.82) contrast(.96) brightness(1.03);transform:scale(1.12)}
.fm-farm-haze{position:absolute;inset:0;background:linear-gradient(#dff1f01f,#fff0 24%,#173e2452 100%);pointer-events:none;z-index:1}
.fm-farm-sites{position:absolute;inset:0;z-index:3}
.fm-site{--x:50%;--y:50%;position:absolute!important;left:var(--x);top:var(--y);transform:translate(-50%,-50%);width:62px;height:54px!important;min-height:54px!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;overflow:visible!important}
.fm-site-building-shape{position:absolute;inset:6px 4px 2px;display:grid;place-items:center;border:1px solid #fff9;border-radius:45% 45% 14% 14%;background:linear-gradient(150deg,#f1ead8,#a98f69);box-shadow:0 5px 7px #19311e55;color:#385448;font-size:22px;text-shadow:0 1px #fff;transition:.15s}
.fm-site-track .fm-site-building-shape{border-radius:50%;background:#b99665cc;border:4px double #eee7d5;color:#fff}
.fm-site-pool .fm-site-building-shape{background:#82bdc5d9;border-radius:12px;color:#fff}
.fm-site-empty .fm-site-building-shape{opacity:.38;filter:grayscale(.7)}
.fm-site-building .fm-site-building-shape{outline:2px dashed #d59643;animation:fm-work 1.3s ease-in-out infinite alternate}
.fm-site-dot{position:absolute;right:-2px;top:-4px;min-width:20px;height:20px;border-radius:10px;background:#f6f1dc;color:#3d624e;border:1px solid #76917d;font-size:12px;display:grid;place-items:center;font-weight:800}
.fm-site:not(.fm-site-empty) .fm-site-dot:empty{display:none}
.fm-site-label{display:none;position:absolute;left:50%;bottom:-29px;transform:translateX(-50%);white-space:nowrap;background:#fffdf1ef;border:1px solid #91a88f;border-radius:5px;padding:2px 6px;color:#314b3e;font-size:11px;line-height:1.25;box-shadow:0 2px 5px #17351f33}
.fm-site-label b{display:block;font-size:10px;color:#66806c}
.fm-build-mode .fm-site-label{display:block}
.fm-build-mode .fm-site{margin-bottom:8px}
.fm-farm-animals{position:absolute;inset:0;z-index:2;pointer-events:none}.fm-farm-animals i{position:absolute;left:var(--x);top:var(--y);font-style:normal;color:#513d2d;font-size:18px;text-shadow:0 1px 2px #fff8;animation:fm-horse 4s ease-in-out infinite alternate}
.fm-map-summary{display:flex;gap:6px;overflow-x:auto;margin:-2px 0 9px;padding:7px 2px 3px;scrollbar-width:none}.fm-map-summary span{flex:0 0 auto;background:#fffdf5;border:1px solid #d8e0d2;border-radius:15px;padding:4px 9px;font-size:12px;color:#4c6255}
.fm-home-shortcuts{display:grid;grid-template-columns:repeat(3,1fr);gap:7px;margin:10px 0}.fm-home-shortcuts .fm-button{font-size:13px;min-height:44px!important;background:#fffdf7!important}
.fm-farmyard .fm-scene-title{top:10px;left:12px}.fm-farmyard .fm-scene-title strong{font-size:19px}.fm-farmyard .fm-scene-bottom{bottom:10px;justify-content:flex-end}.fm-farmyard .fm-build-button{background:#f8f1d9e8!important;color:#3b5948!important;border-color:#d3b878!important;font-weight:700}
@keyframes fm-work{to{transform:translateY(-2px)}}@keyframes fm-horse{to{transform:translateX(7px)}}
@media(max-width:359px){.fm-farmyard{min-height:500px}.fm-site{transform:translate(-50%,-50%) scale(.88)}.fm-site-label{font-size:10px}}


/* v7.1.140 Open-land diorama: background contains no farm facilities. */
.fm-open-farm{position:relative;min-height:780px;overflow:hidden;background:#83a96b;isolation:isolate}
.fm-open-land{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;z-index:0}
.fm-open-farm:after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,rgba(255,255,255,.03),rgba(23,60,37,.08));z-index:1}
.fm-open-farm .fm-scene-title,.fm-open-farm .fm-scene-bottom,.fm-object-layer,.fm-open-farm .fm-farm-animals{z-index:4}
.fm-object-layer{position:absolute;inset:0}
.fm-obj{position:absolute;left:var(--x);top:var(--y);width:104px;height:80px;transform:translate(-50%,-70%) scale(var(--persp));transform-origin:50% 80%;border:0;background:none;padding:0;filter:drop-shadow(0 5px 5px rgba(24,54,34,.28));z-index:calc(10 + var(--y))}
.fm-iso{position:absolute;inset:0;display:block}
.fm-iso i{position:absolute;display:block}
.fm-iso-shadow{left:13%;right:7%;bottom:3%;height:20%;background:#163c2938;border-radius:50%;filter:blur(4px)}
.fm-iso-main{left:15%;right:11%;bottom:15%;height:48%;background:#d6b17b;border:2px solid #7a664c;border-radius:5px;transform:skewY(-5deg)}
.fm-iso-sub{left:8%;right:5%;top:13%;height:34%;background:#456b5c;clip-path:polygon(7% 100%,22% 13%,77% 13%,98% 100%)}
.fm-iso-detail{left:32%;bottom:15%;width:14%;height:29%;background:#5b4a3a;box-shadow:32px 4px 0 -3px #e7dfc8}
.fm-tier-0{opacity:.18;filter:grayscale(1)}
.fm-tier-1{transform:scale(.82)}.fm-tier-3{transform:scale(1)}.fm-tier-5{transform:scale(1.16)}
.fm-tier-5 .fm-iso-main{box-shadow:-23px 7px 0 -5px #c99f6d,25px -2px 0 -5px #e0bd86}
.fm-obj-hill{width:155px;height:72px}.fm-obj-hill .fm-iso-main,.fm-obj-track .fm-iso-main{left:4%;right:4%;height:38%;bottom:15%;background:#a47d51;border:4px solid #f0eee3;border-radius:48% 8px 8px 48%;transform:skewY(-9deg)}.fm-obj-hill .fm-iso-sub,.fm-obj-hill .fm-iso-detail,.fm-obj-track .fm-iso-sub,.fm-obj-track .fm-iso-detail{display:none}
.fm-obj-track{width:135px;height:80px}.fm-obj-track .fm-iso-main{height:55%;border-radius:50%;background:#9a7955;transform:none;box-shadow:inset 0 0 0 10px #78a15e}
.fm-obj-walker .fm-iso-main,.fm-obj-pen .fm-iso-main{left:14%;right:14%;bottom:8%;height:68%;border-radius:50%;background:#657a72;border:9px solid #e1e3d9;box-shadow:inset 0 0 0 9px #8ea878}.fm-obj-walker .fm-iso-sub,.fm-obj-walker .fm-iso-detail,.fm-obj-pen .fm-iso-sub,.fm-obj-pen .fm-iso-detail{display:none}
.fm-obj-pool{width:130px}.fm-obj-pool .fm-iso-main{left:5%;right:5%;height:55%;bottom:10%;background:linear-gradient(165deg,#7ce8f3,#20afd1);border:8px solid #e9ebe2;box-shadow:inset 0 0 0 3px #d9fbff88;transform:none}.fm-obj-pool .fm-iso-sub{display:none}.fm-obj-pool .fm-iso-detail{left:18%;bottom:35%;width:58%;height:3px;background:#f4ffff88;box-shadow:15px 10px 0 #eaffff66}
.fm-obj-arena .fm-iso-main{height:55%;background:#d3b48a}.fm-obj-arena .fm-iso-sub{background:#687a78}
.fm-obj-gate .fm-iso-main{height:50%;background:repeating-linear-gradient(90deg,#596a65 0 4px,#e6e8e0 4px 10px)}.fm-obj-gate .fm-iso-sub,.fm-obj-gate .fm-iso-detail{display:none}
.fm-obj-care .fm-iso-main{background:#e0d3b5}.fm-obj-care .fm-iso-sub{background:#637b72}
.fm-obj-office{width:88px;height:68px}
.fm-obj-badge{position:absolute;right:2px;top:-6px;min-width:27px;height:27px;line-height:27px;padding:0 5px;border-radius:15px;background:#fff9e9;color:#315a4e;border:2px solid #527568;font-size:12px;font-weight:800}
.fm-obj-name{position:absolute;left:50%;top:72%;transform:translateX(-50%);white-space:nowrap;background:#fffbedeb;border:1px solid #d8c9a7;border-radius:8px;padding:3px 7px;color:#2b5046;font-size:11px;font-weight:800}
.fm-open-farm:not(.fm-build-mode) .fm-obj-empty{display:none}
.fm-river-shimmer{position:absolute;left:-10%;bottom:5%;width:72%;height:13%;opacity:.18;z-index:2;background:repeating-linear-gradient(165deg,transparent 0 14px,#d9ffff 15px 17px,transparent 18px 31px);mix-blend-mode:screen;animation:fmRiverFlow 7s linear infinite;clip-path:polygon(0 42%,18% 23%,40% 37%,61% 18%,100% 37%,100% 65%,65% 48%,43% 69%,18% 52%,0 70%)}
@keyframes fmRiverFlow{from{background-position:0 0}to{background-position:140px 0}}
.fm-open-farm .fm-farm-animals i{position:absolute;left:var(--x);top:var(--y);font-size:18px;color:#4b3023;text-shadow:0 1px 2px #fff;animation:fmHorseDrift 8s ease-in-out infinite alternate}
@keyframes fmHorseDrift{from{transform:translateX(-9px)}to{transform:translateX(15px)}}
.fm-open-farm .fm-build-button{position:absolute;right:14px;bottom:14px}
@media(max-width:600px){.fm-open-farm{min-height:700px}.fm-obj{width:96px;height:74px}.fm-obj-hill{width:140px}.fm-obj-pool,.fm-obj-track{width:118px}}


/* v7.1.141 real facility artwork; supersedes CSS placeholder miniatures */
.fm-obj{width:150px;height:110px}
.fm-object-art{position:absolute;left:50%;bottom:8%;max-width:100%;max-height:100%;transform:translateX(-50%);object-fit:contain;pointer-events:none;filter:drop-shadow(0 4px 3px rgba(25,55,34,.28))}
.fm-object-shadow{position:absolute;left:16%;right:10%;bottom:5%;height:14%;border-radius:50%;background:rgba(24,54,34,.18);filter:blur(5px)}
.fm-empty-marker{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:46px;height:46px;border-radius:50%;display:grid;place-items:center;background:rgba(250,248,231,.82);border:2px dashed #607d6f;color:#3e6759;font-size:28px;font-weight:800}
.fm-obj-empty{filter:none}
.fm-build-mode .fm-obj-empty{display:block}
.fm-open-farm:not(.fm-build-mode) .fm-obj-empty{display:none}
.fm-open-farm .fm-farm-animals i{transform:scale(var(--hs,1));transform-origin:center bottom}
.fm-open-farm .fm-farm-animals i:nth-child(1){animation:fmHorseLandA 8s ease-in-out infinite alternate}
.fm-open-farm .fm-farm-animals i:nth-child(2){animation:fmHorseLandB 9s ease-in-out infinite alternate}
.fm-open-farm .fm-farm-animals i:nth-child(3){animation:fmHorseLandC 7s ease-in-out infinite alternate}
@keyframes fmHorseLandA{from{margin-left:-7px}to{margin-left:10px}}
@keyframes fmHorseLandB{from{margin-left:-10px}to{margin-left:8px}}
@keyframes fmHorseLandC{from{margin-left:-6px}to{margin-left:12px}}
@media(max-width:600px){.fm-obj{width:138px;height:102px}}
/* v7.1.143 free farm layout */
.fm-diamond-grid{position:absolute;inset:0;z-index:2;pointer-events:none}
.fm-grid-cell{position:absolute;left:var(--x);top:var(--y);width:38px;height:25px;transform:translate(-50%,-50%) skewY(-18deg) rotate(45deg);border:1px solid rgba(245,255,238,.78);background:rgba(108,188,112,.19);box-shadow:inset 0 0 0 1px rgba(45,105,61,.15);pointer-events:auto;padding:0}
.fm-grid-cell:not(:disabled):active{background:rgba(255,240,126,.58)}
.fm-grid-cell:disabled{opacity:.22}.fm-grid-cell.fm-grid-blocked{background:rgba(190,78,70,.28);border-color:rgba(255,210,205,.7)}
.fm-layout-palette{position:absolute;left:8px;right:8px;bottom:58px;z-index:8;display:flex;gap:6px;overflow-x:auto;padding:7px;border-radius:13px;background:rgba(247,248,235,.91);backdrop-filter:blur(7px);box-shadow:0 3px 12px rgba(20,52,36,.2)}
.fm-layout-palette .fm-button{flex:0 0 auto;min-height:40px;padding:6px 9px;font-size:11px;border-radius:10px}.fm-layout-palette small{display:block;font-size:9px;opacity:.72}
.fm-layout-palette .fm-selected{outline:2px solid #376b58;background:#e8f3e8}
.fm-layout-mode .fm-scene-bottom{z-index:9}.fm-layout-mode .fm-build-button{display:none}
.fm-layout-selected{filter:drop-shadow(0 0 7px #fff7a6) drop-shadow(0 4px 4px rgba(24,54,34,.28))}
.fm-layout-selected:after{content:'移動中';position:absolute;left:50%;bottom:-9px;transform:translateX(-50%);font-size:9px;font-weight:800;color:#fff;background:#356856;border-radius:8px;padding:2px 6px;white-space:nowrap}
@media(max-width:600px){.fm-grid-cell{width:34px;height:22px}.fm-layout-palette{bottom:54px}}


/* v7.1.144 compact mobile HUD + guided layout flow */
.fm-compact-hud{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:2px 10px;padding:7px 12px;background:rgba(247,250,239,.96);border-bottom:1px solid #d8dfcf;color:#234f43;min-height:46px}
.fm-compact-hud strong{font-size:16px;white-space:nowrap}.fm-compact-hud span{font-size:11px}.fm-compact-hud b{font-size:14px;text-align:right}.fm-compact-hud small{grid-column:1/-1;font-size:10px;color:#607568;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.fm-layout-guide{position:absolute;z-index:30;top:9px;left:50%;transform:translateX(-50%);padding:7px 12px;border-radius:18px;background:rgba(22,73,57,.91);color:white;font-size:12px;font-weight:800;white-space:nowrap;box-shadow:0 3px 9px #18392c44}
.fm-layout-palette{position:absolute!important;z-index:35;left:8px;right:8px;bottom:58px;background:rgba(249,249,237,.96);border:1px solid #d8cfb4;border-radius:14px;padding:7px;box-shadow:0 6px 18px #173b2b44;overflow:hidden}
.fm-layout-palette>strong{display:block;font-size:11px;color:#365c50;margin:0 3px 5px}.fm-layout-palette>div{display:flex;gap:6px;overflow-x:auto;padding-bottom:3px;scrollbar-width:none}.fm-layout-palette>div::-webkit-scrollbar{display:none}
.fm-layout-palette button{flex:0 0 auto;min-width:82px;padding:7px 9px;border-radius:10px;font-size:11px}.fm-layout-palette button small{display:block;font-size:9px;opacity:.72}
.fm-layout-palette .fm-selected{outline:3px solid #57a976;background:#e4f5df}
.fm-grid-cell{opacity:.38}.fm-grid-cell:not(.fm-grid-blocked):not(:disabled){opacity:.86;filter:drop-shadow(0 0 5px #8dff9a)}
.fm-grid-blocked{opacity:.16!important}
.fm-layout-mode .fm-scene-bottom{z-index:40;bottom:8px}
@media(max-width:600px){
 .fm-content{padding-top:0!important}
 .fm-shell[data-farm-pane="home"] .fm-open-farm,.fm-shell[data-farm-pane="map"] .fm-open-farm{height:calc(100svh - 178px);min-height:560px;max-height:760px}
 .fm-open-land{object-position:center center}
 .fm-shell[data-farm-pane="home"] .fm-map-summary{position:absolute;z-index:45;left:8px;right:8px;bottom:68px;margin:0;background:rgba(249,249,237,.9);backdrop-filter:blur(4px)}
 .fm-shell[data-farm-pane="home"] .fm-content>.fm-card,.fm-shell[data-farm-pane="home"] .fm-content>.fm-home-shortcuts{display:none}
 .fm-compact-hud{padding:5px 10px;min-height:40px}.fm-compact-hud strong{font-size:14px}.fm-compact-hud small{font-size:9px}
}

.fm-sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}


/* v7.1.145 portrait/landscape containment + tappable build grid */
.fm-shell,.fm-content,.fm-open-farm{width:100%;max-width:100%;box-sizing:border-box;min-width:0}
.fm-content{overflow-x:hidden}
.fm-open-farm{overflow:hidden}
.fm-open-land{width:100%!important;max-width:100%;left:0;right:0}
.fm-layout-mode .fm-diamond-grid{position:absolute;inset:0;z-index:60!important;pointer-events:none!important}
.fm-layout-mode .fm-grid-cell{pointer-events:auto!important;touch-action:manipulation;cursor:pointer;z-index:61!important}
.fm-layout-mode .fm-grid-cell:not(:disabled){pointer-events:auto!important}
.fm-layout-mode .fm-object-layer,.fm-layout-mode .fm-farm-animals,.fm-layout-mode .fm-river-shimmer{pointer-events:none!important}
.fm-layout-mode .fm-obj{pointer-events:none!important}
.fm-layout-palette{box-sizing:border-box;max-width:calc(100% - 16px)!important;width:auto!important}
.fm-layout-palette>div{width:100%;max-width:100%;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
.fm-layout-palette button{max-width:44vw}
.fm-scene-bottom{max-width:calc(100% - 16px);box-sizing:border-box}
@media (orientation:portrait) and (max-width:600px){
 .fm-shell[data-farm-pane="home"] .fm-open-farm,.fm-shell[data-farm-pane="map"] .fm-open-farm{height:calc(100svh - 174px);min-height:520px;max-height:none}
 .fm-layout-palette{bottom:58px;left:6px;right:6px}
 .fm-layout-guide{top:6px;max-width:90%;overflow:hidden;text-overflow:ellipsis}
}
@media (orientation:landscape) and (max-height:600px){
 .fm-compact-hud{min-height:32px;padding:3px 8px;grid-template-columns:1fr auto auto}
 .fm-compact-hud small{display:none}
 .fm-shell[data-farm-pane="home"] .fm-open-farm,.fm-shell[data-farm-pane="map"] .fm-open-farm{height:calc(100svh - 116px);min-height:280px;max-height:none}
 .fm-layout-palette{left:6px;right:6px;bottom:48px;padding:4px 6px}
 .fm-layout-palette>strong{display:none}
 .fm-layout-palette button{min-width:72px;padding:5px 7px}
 .fm-layout-guide{top:4px;padding:4px 9px;font-size:10px}
 .fm-scene-bottom{bottom:4px}
 .fm-nav{min-height:46px}
}


/* v7.1.146 stable iOS touch targets: hitbox is rectangular, diamond is visual only */
.fm-layout-mode .fm-grid-cell{
  width:52px!important;height:52px!important;
  margin:0!important;padding:0!important;
  transform:translate(-50%,-50%)!important;
  border:0!important;background:transparent!important;
  box-shadow:none!important;filter:none!important;
  opacity:1!important;
  -webkit-tap-highlight-color:rgba(72,150,92,.18);
  touch-action:manipulation!important;
  pointer-events:auto!important;
}
.fm-layout-mode .fm-grid-cell::before{
  content:"";position:absolute;left:50%;top:50%;
  width:31px;height:31px;
  transform:translate(-50%,-50%) rotate(45deg) skew(-8deg,-8deg);
  border:1.5px solid rgba(240,255,238,.92);
  border-radius:7px;
  background:rgba(91,183,104,.20);
  box-shadow:inset 0 0 0 1px rgba(36,102,55,.14),0 0 4px rgba(98,220,116,.12);
  pointer-events:none;
}
.fm-layout-mode .fm-grid-cell.fm-grid-ready:not(.fm-grid-blocked)::before{
  background:rgba(87,205,102,.30);
  border-color:rgba(237,255,233,.98);
  box-shadow:0 0 8px rgba(91,232,112,.48),inset 0 0 0 1px rgba(28,103,47,.18);
}
.fm-layout-mode .fm-grid-cell.fm-grid-blocked::before{
  background:rgba(184,77,68,.24);border-color:rgba(255,207,200,.82);box-shadow:none;
}
.fm-layout-mode .fm-grid-cell:active::before{background:rgba(255,231,99,.58)!important;transform:translate(-50%,-50%) rotate(45deg) skew(-8deg,-8deg) scale(.94)}
.fm-layout-mode .fm-diamond-grid{z-index:80!important}
.fm-layout-mode .fm-grid-cell{z-index:81!important}
.fm-layout-mode .fm-layout-guide{pointer-events:none!important;z-index:90!important}
.fm-layout-mode .fm-layout-palette{z-index:95!important}
.fm-layout-mode .fm-scene-bottom{z-index:96!important}
@media(max-width:600px){
 .fm-layout-mode .fm-grid-cell{width:50px!important;height:50px!important}
 .fm-layout-mode .fm-grid-cell::before{width:29px;height:29px}
}


/* v7.1.147 farm full-bleed HUD/navigation + missing facility art sizing */
.fm-object-art{width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;object-fit:contain!important}
.fm-obj-walker .fm-object-art{width:118%!important;height:118%!important}
.fm-obj-track .fm-object-art{width:125%!important;height:125%!important}
.fm-obj-hill .fm-object-art{width:130%!important;height:130%!important}

/* On farm home/map, HUD floats over the sky instead of consuming vertical space. */
.fm-shell[data-farm-pane="home"],.fm-shell[data-farm-pane="map"]{position:relative}
.fm-shell[data-farm-pane="home"] .fm-compact-hud,.fm-shell[data-farm-pane="map"] .fm-compact-hud{
 position:absolute;z-index:120;top:0;left:0;right:0;
 margin:0 10px;padding:7px 10px;
 background:linear-gradient(180deg,rgba(247,250,239,.90),rgba(247,250,239,.70));
 border:1px solid rgba(230,237,220,.72);border-radius:0 0 14px 14px;
 backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);
 box-shadow:0 2px 8px rgba(26,60,44,.12);
}
.fm-shell[data-farm-pane="home"] .fm-content,.fm-shell[data-farm-pane="map"] .fm-content{padding-top:0!important}
.fm-shell[data-farm-pane="home"] .fm-open-farm,.fm-shell[data-farm-pane="map"] .fm-open-farm{
 height:calc(100svh - 78px)!important;min-height:580px!important;max-height:none!important;border-radius:0!important;margin:0!important;
}
.fm-shell[data-farm-pane="home"] .fm-open-land,.fm-shell[data-farm-pane="map"] .fm-open-land{object-position:center center}

/* Bottom five-tab navigation overlays the river. */
.fm-shell[data-farm-pane="home"] .fm-nav,.fm-shell[data-farm-pane="map"] .fm-nav{
 position:absolute!important;z-index:130;left:8px;right:8px;bottom:6px;
 width:auto!important;margin:0!important;
 background:rgba(248,250,239,.82)!important;
 border:1px solid rgba(231,235,218,.82);border-radius:16px;
 backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px);
 box-shadow:0 4px 16px rgba(18,55,37,.18);
}
.fm-shell[data-farm-pane="home"] .fm-scene-bottom,.fm-shell[data-farm-pane="map"] .fm-scene-bottom{bottom:72px!important}
.fm-shell[data-farm-pane="home"] .fm-map-summary{bottom:72px!important}
.fm-shell[data-farm-pane="map"] .fm-layout-palette{bottom:72px!important}

/* Hide redundant back-to-home row in the map pane: bottom nav already supplies it. */
.fm-shell[data-farm-pane="map"] .fm-content>.fm-back{display:none!important}
@media(orientation:landscape) and (max-height:600px){
 .fm-shell[data-farm-pane="home"] .fm-open-farm,.fm-shell[data-farm-pane="map"] .fm-open-farm{height:calc(100svh - 22px)!important;min-height:300px!important}
 .fm-shell[data-farm-pane="home"] .fm-compact-hud,.fm-shell[data-farm-pane="map"] .fm-compact-hud{padding:3px 8px;margin:0 8px}
 .fm-shell[data-farm-pane="home"] .fm-nav,.fm-shell[data-farm-pane="map"] .fm-nav{bottom:4px}
 .fm-shell[data-farm-pane="map"] .fm-layout-palette{bottom:54px!important}
 .fm-shell[data-farm-pane="home"] .fm-scene-bottom,.fm-shell[data-farm-pane="map"] .fm-scene-bottom{bottom:54px!important}
}


/* v7.1.148 production farm facility art: fixed-canvas direct-alpha assets */
.fm-object-shadow{display:none!important}
.fm-obj{width:150px!important;height:112px!important}
.fm-object-art{
  left:50%!important;bottom:0!important;
  width:100%!important;height:100%!important;
  max-width:none!important;max-height:none!important;
  transform:translateX(-50%)!important;
  object-fit:contain!important;
  filter:drop-shadow(0 3px 3px rgba(24,54,34,.20))!important;
}
.fm-obj-barn{width:180px!important;height:132px!important}
.fm-obj-hill,.fm-obj-track{width:210px!important;height:112px!important}
.fm-obj-arena{width:178px!important;height:122px!important}
.fm-obj-walker{width:150px!important;height:118px!important}
.fm-obj-treadmill{width:154px!important;height:118px!important}
.fm-obj-pool{width:168px!important;height:118px!important}
.fm-obj-gate{width:145px!important;height:112px!important}
.fm-obj-pen{width:154px!important;height:118px!important}
.fm-obj-measurement{width:154px!important;height:118px!important}
.fm-obj-care{width:158px!important;height:118px!important}
@media(max-width:600px){
 .fm-obj-barn{width:170px!important;height:126px!important}
 .fm-obj-hill,.fm-obj-track{width:196px!important;height:106px!important}
}
