.farm-panel{color:#f3efdd}.farm-panel h4{margin:10px 0 5px;color:#f1d895}.farm-speech{font-size:14px;line-height:1.55;margin:5px 0 12px}.farm-goods{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;margin:6px 0}.farm-note{display:block;font-size:12px;color:#d2c9b2}
.farm-shop-choices{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:12px 0}.farm-shop-question{font-size:18px;font-weight:700}
#panel .farm-button{border:1px solid #a29a83;border-radius:6px;background:#292d29;color:#fffcf1;font:inherit;font-size:13px;min-height:36px;padding:5px 8px;cursor:pointer}#panel .farm-button:disabled{opacity:.57}#panel .farm-button[aria-pressed=true]{background:#315c41;border-color:#c1da87}
.farm-pen-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}#panel .farm-pen-actions .farm-button{flex:1 1 160px;min-height:44px;touch-action:manipulation}
@media(max-width:540px){.farm-panel .farm-speech{font-size:12px}.farm-panel .butler-art{height:125px}.farm-panel .butler-portrait{width:112px;height:122px;margin:0}.farm-panel .farm-goods button{font-size:11px}}
.farm-seed-hud{position:fixed;right:calc(12px + max(env(safe-area-inset-right,0px),var(--app-safe-right,0px)));bottom:calc(76px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)));width:184px;max-width:calc(100vw - 24px);z-index:24;padding:6px;border:1px solid #d9d9d9;border-radius:7px;background:rgba(8,10,12,.78);color:#fff;font:13px/1.35 system-ui,sans-serif;box-sizing:border-box;touch-action:manipulation}
.farm-seed-hud[hidden],.farm-seed-choices[hidden],body:not(.in-game) .farm-seed-hud,body.chat-open .farm-seed-hud{display:none!important}
.farm-seed-hud .farm-button{display:block;width:100%;min-height:44px;padding:7px;border:1px solid #aaa;border-radius:4px;background:rgba(16,18,20,.82);color:#fff;font:inherit;cursor:pointer;touch-action:manipulation}
.farm-seed-hud .farm-button[aria-pressed=true]{border-color:#cee896;background:rgba(59,86,41,.9)}
.farm-seed-hud .farm-button:focus-visible{outline:2px solid #e1f3a5;outline-offset:2px}
.farm-seed-hud .farm-button:disabled{opacity:.6;cursor:wait}
.farm-seed-choices{display:grid;gap:5px;padding-top:5px}.farm-seed-hint{font-size:11px;line-height:1.45;color:#e0ddcd;padding:2px}
@media(pointer:coarse),(max-width:600px){.farm-seed-hud{right:calc(8px + max(env(safe-area-inset-right,0px),var(--app-safe-right,0px)));bottom:calc(150px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)));width:164px;font-size:12px;max-height:calc(100dvh - 170px);overflow-y:auto}}
@media(max-height:420px){.farm-seed-hud{bottom:calc(110px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)));width:154px;max-height:calc(100dvh - 126px)}}

.farm-offer .farm-button{width:100%}.farm-offer .farm-note{margin:5px 1px 8px;line-height:1.4}
.farm-order-quantity{display:flex;align-items:center;justify-content:center;gap:6px;margin:8px 0}.farm-order-quantity output{min-width:36px;text-align:center;font-weight:700}
#panel .farm-order-quantity .farm-button{width:44px;min-width:44px;height:44px;min-height:44px;padding:0}
@media(max-height:420px){.farm-seed-choices{grid-template-columns:repeat(2,minmax(0,1fr))}.farm-seed-hint{display:none}}
.farm-tap-hint{display:block;padding:5px 1px 0;color:#e0ddcd;font-size:11px;line-height:1.35;text-align:center}
/* Land purchase card: scoped so other game panels keep their own appearance. */
#panel.farm-land-panel .panel-card{width:min(480px,100%);box-sizing:border-box;padding:22px;border:1px solid #ffffff70!important;border-radius:20px!important;background:linear-gradient(145deg,#191d20,#0c0e11)!important;box-shadow:0 22px 70px #0009,inset 0 1px #ffffff0d;max-height:calc(var(--visual-height,100dvh) - 32px);overflow:auto}
#panel.farm-land-panel .panel-head{gap:12px;align-items:center;margin:0 0 16px;padding-bottom:14px;border-bottom:1px solid #ffffff1c}
#panel.farm-land-panel .panel-head h2{margin:0;font-size:23px;line-height:1.25}
#panel.farm-land-panel #close-panel{flex:none;width:44px;height:44px;min-height:44px;padding:0;border-radius:12px!important;border:1px solid #ffffff50!important;background:#ffffff08!important}
#panel.farm-land-panel .farm-speech{line-height:1.6;margin:0 0 14px;color:#e4e5dc}
#panel.farm-land-panel .farm-button{min-height:44px;padding:10px 16px;border-radius:12px!important;border:1px solid #ffffff60!important;background:#ffffff09!important}
#panel.farm-land-panel .farm-land-buy{width:100%;margin:0 0 16px;font-size:14px;font-weight:650;background:#ecd6b5!important;border-color:#f7e6c9!important;color:#181512!important}
#panel.farm-land-panel .farm-land-buy:hover:not(:disabled){background:#f3dfbf!important}
#panel.farm-land-panel .farm-land-buy:disabled{opacity:.75!important;cursor:not-allowed}
#panel.farm-land-panel button:focus-visible{outline:2px solid #e3c89e;outline-offset:3px}
@media(max-width:540px){#panel.farm-land-panel .panel-card{padding:18px}#panel.farm-land-panel .panel-head h2{font-size:20px}}
/* Fixed safe-area anchored controls. The picker sits above this row, not over it. */
.farm-visit-hud{position:fixed;right:calc(12px + max(env(safe-area-inset-right,0px),var(--app-safe-right,0px)));bottom:calc(66px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)));display:flex;gap:6px;align-items:stretch;z-index:23;max-width:calc(100vw - 24px);pointer-events:none}
.farm-visit-hud .farm-button{pointer-events:auto;min-height:44px;width:136px;max-width:42vw;padding:7px 9px;border:1px solid #d8c39a;border-radius:10px;background:rgba(15,22,20,.82);color:#fff1d3;font:12px/1.3 system-ui,sans-serif;touch-action:manipulation;cursor:pointer}
.farm-visit-hud .farm-button:disabled{opacity:.55}.farm-visit-hud [hidden],.farm-visit-hud[hidden],body:not(.in-game) .farm-visit-hud,body.chat-open .farm-visit-hud,body.android-chat-open .farm-visit-hud{display:none!important}
.farm-seed-hud{bottom:calc(118px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)))}
.farm-friends-list{max-height:55dvh;overflow:auto}.farm-friend-row{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid #ffffff20}.farm-friend-row>span{flex:1;overflow-wrap:anywhere;min-width:0}#panel .farm-friend-row .farm-button{flex:none;min-width:72px;min-height:44px}
@media(pointer:coarse),(max-width:600px){.farm-visit-hud{right:calc(8px + max(env(safe-area-inset-right,0px),var(--app-safe-right,0px)));bottom:calc(56px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)))}.farm-visit-hud .farm-button{width:124px;font-size:11px}.farm-seed-hud{bottom:calc(108px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)));max-height:calc(100dvh - 176px)}}
@media(max-height:420px){.farm-seed-hud{right:calc(170px + max(env(safe-area-inset-right,0px),var(--app-safe-right,0px)));bottom:calc(110px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)));max-height:calc(100dvh - 140px)}}

/* PC: keep the full text in a horizontal button, directly left of fullscreen. */
@media(min-width:801px) and (pointer:fine){
 .farm-visit-hud{right:calc(var(--edge,14px) + 46px);bottom:max(16px,env(safe-area-inset-bottom,0px))}
 body:has(.farm-visit-hud:not([hidden])) .canvas-wrap .actions{right:var(--edge,14px);bottom:max(16px,env(safe-area-inset-bottom,0px))}
 .farm-visit-hud .farm-button{box-sizing:border-box;width:auto;max-width:none;height:36px;min-height:36px;padding:0 12px;white-space:nowrap;display:inline-flex;align-items:center;justify-content:center}
}
/* A narrow PC window keeps Return above Visit, clear of the five quick slots. */
@media(min-width:801px) and (max-width:1100px) and (pointer:fine){
 .farm-visit-hud{flex-direction:column;align-items:flex-end}
}

/* Mobile: pin farm navigation to the usable bottom edge, not above the hotbar.
   Only while the row is visible, make room with the other compact controls. */
html:is(.mobile-polish,.android-shell){
 --farm-nav-button-width:min(124px,calc((100vw - max(env(safe-area-inset-left,0px),var(--app-safe-left,0px)) - max(env(safe-area-inset-right,0px),var(--app-safe-right,0px)) - 68px) / 2));
}
html:is(.mobile-polish,.android-shell) .farm-visit-hud{
 right:calc(8px + max(env(safe-area-inset-right,0px),var(--app-safe-right,0px)));
 bottom:calc(8px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)));
 flex-direction:row;align-items:stretch;
}
html:is(.mobile-polish,.android-shell) .farm-visit-hud .farm-button{
 box-sizing:border-box;width:var(--farm-nav-button-width);max-width:42vw;height:auto;min-height:44px;
 padding:7px 9px;white-space:normal;font-size:11px;
}
html:is(.mobile-polish,.android-shell) body:has(.farm-visit-hud:not([hidden])) .canvas-wrap .actions{
 bottom:calc(60px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)))!important;
}
@media(max-width:799px){
 html:is(.mobile-polish,.android-shell) body:has(.farm-visit-hud:not([hidden])) .canvas-wrap .quickbar{
  bottom:calc(64px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)))!important;
 }
 html:is(.mobile-polish,.android-shell) body:has(.farm-visit-hud:not([hidden])) .canvas-wrap .actions{
  bottom:calc(8px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)))!important;
  right:calc(16px + max(env(safe-area-inset-right,0px),var(--app-safe-right,0px)) + var(--farm-nav-button-width))!important;
 }
 html:is(.mobile-polish,.android-shell) body:has(.farm-visit-hud:not([hidden]) #farm-return-btn:not([hidden])) .canvas-wrap .actions{
  right:calc(22px + max(env(safe-area-inset-right,0px),var(--app-safe-right,0px)) + var(--farm-nav-button-width) + var(--farm-nav-button-width))!important;
 }
}
@media(orientation:portrait){
 html:is(.mobile-polish,.android-shell) body:has(.farm-visit-hud:not([hidden])) .canvas-wrap .left-status-stack{
  bottom:calc(120px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)))!important;
 }
 html:is(.mobile-polish,.android-shell) .farm-seed-hud{
  bottom:calc(196px + max(env(safe-area-inset-bottom,0px),var(--app-safe-bottom,0px)));
  max-height:calc(100dvh - 264px);
 }
}

/* Seed inventory is a semantic status, distinct from the gold purchase price. */
.farm-offer>.farm-seed-stock{display:block;margin-top:4px;font-size:12px;font-weight:600}
@layer rp-theme{#panel .farm-seed-stock{color:#73df90!important}}
