#phone-app:has(#phone-farm:not([hidden])) { padding: 0; overflow: hidden; background: #101819; }
#phone-app:has(#phone-farm:not([hidden])) > header { flex: none; }
#phone-farm {
  --pf-ink: #f7f3e9; --pf-dim: #afbeb4; --pf-line: #35463e; --pf-card: #1b2828; --pf-mint: #aff1a5;
  display: flex; flex: 1; min-width: 0; min-height: 0; color: var(--pf-ink); background: #101819;
  font: 500 13px/1.35 -apple-system,BlinkMacSystemFont,Arial,sans-serif;
}
#phone-farm .pf-scroll {
  flex: 1; min-width: 0; padding: 2px 11px 12px; overflow-y: auto; overscroll-behavior: contain;
  touch-action: pan-y; scrollbar-width: thin; scrollbar-color: #697b6e6b transparent;
}
#city-phone .pf-symbols { position: absolute; width: 0; height: 0; }
#phone-farm button:focus-visible, #phone-farm .pf-field:focus-within { outline: 2px solid var(--pf-mint); outline-offset: -2px; }
#city-phone :is(#pf-headline,#pf-feed [data-story="berezovka"]) {
  position: relative; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; justify-content: flex-end;
  width: 100%; aspect-ratio: 1.5; padding: 14px; border: 1px solid #415443; border-radius: 15px; text-align: left;
  color: #fff9e9; background: linear-gradient(0deg,#09120cee 0%,#10170c00 85%),url('../assets/farm-news.webp') 50% 48% / cover;
}
#pf-headline strong, #pf-feed [data-story="berezovka"] strong, #pf-article h3 {
  max-width: 9em; font: 600 clamp(22px,2vw,31px)/1 Georgia,serif; letter-spacing: -.035em;
}
#pf-headline strong, #pf-feed [data-story="berezovka"] strong { max-width: 7em; }
#pf-headline small, #pf-feed [data-story="berezovka"] small { font-size: 11px; color: #ebeedf; }
#pf-headline::after, #pf-feed [data-story="berezovka"]::after {
  content: '›'; position: absolute; right: 10px; bottom: 12px; display: grid; place-items: center; width: 24px; height: 24px;
  border: 1px solid #d7e2c988; border-radius: 50%; font: 20px/1 Arial,sans-serif;
}
.pf-apps { display: grid; gap: 6px; margin-top: 9px; }
#city-phone .pf-apps button, #city-phone #pf-feed [data-story="druzhok"], #city-phone #pf-people button {
  display: flex; align-items: center; gap: 9px; width: 100%; min-height: 48px; padding: 6px 9px;
  border: 1px solid var(--pf-line); border-radius: 12px; background: var(--pf-card); color: var(--pf-ink);
  text-align: left; font-weight: 650;
}
.pf-apps button::after, #pf-feed [data-story="druzhok"]::after { content: '›'; margin-left: auto; color: var(--pf-dim); font: 18px Arial,sans-serif; }
#city-phone .pf-apps svg, #city-phone #pf-feed [data-story="druzhok"] svg {
  flex: none; width: 33px; height: 33px; padding: 7px; border-radius: 10px; color: #55351f; background: linear-gradient(145deg,#ffde92,#e5ac66);
}
#city-phone #pf-players svg { color: #173c25; background: linear-gradient(145deg,#c2eda1,#75b978); }
#city-phone #pf-feed [data-story="druzhok"] { display: grid; grid-template-columns: 33px minmax(0,1fr) auto; gap: 1px 7px; margin-top: 8px; }
#city-phone #pf-feed [data-story="druzhok"] svg { grid-row: span 2; color: #e9bd91; background: #45372f; }
#pf-feed [data-story="druzhok"] strong { grid-column: 2; grid-row: 2; }
#pf-feed [data-story="druzhok"]::after { grid-column: 3; grid-row: 1 / 3; }
#pf-feed small, #pf-article small { font-size: 11px; color: var(--pf-dim); }
#pf-article[data-story="berezovka"]::before {
  content: ''; display: block; margin-bottom: 10px; aspect-ratio: 16 / 9; border-radius: 13px; background: url('../assets/farm-news.webp') center / cover;
}
#city-phone #pf-article > svg { display: block; box-sizing: border-box; width: 100%; height: 88px; padding: 20px; margin-bottom: 8px; border-radius: 13px; background: #45372f; color: #e9bd91; }
#pf-article h3 { margin: 5px 0 10px; }
#pf-article p { margin: 0 0 10px; line-height: 1.52; color: #d9e2d9; }
.pf-field {
  display: flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 9px;
  border: 1px solid #3b5045; border-radius: 10px; background: #192524;
}
#city-phone .pf-field svg { flex: none; width: 15px; height: 15px; color: var(--pf-dim); }
#pf-search { width: 100%; min-width: 0; min-height: 42px; padding: 0; border: 0; outline: 0; background: transparent; color: var(--pf-ink); font: inherit; }
#pf-search::placeholder { opacity: 1; color: #b4c0b8; }
#pf-status, #pf-invite-status, .pf-caption, #pf-plot, #pf-presence { margin: 7px 0; color: var(--pf-dim); font-size: 12px; }
.pf-caption { margin: 10px 2px 5px; font-size: 11px; }
#pf-status:empty, #pf-card-status:empty, #pf-invite-status:empty { display: none; }
#pf-list, #pf-people { list-style: none; padding: 0; margin: 0; }
#pf-list > li + li, #pf-people > li + li { margin-top: 3px; }
#city-phone #pf-list button {
  display: grid; grid-template-columns: minmax(32px,max-content) minmax(0,1fr) auto; align-items: center;
  gap: 7px; width: 100%; min-height: 46px; padding: 4px 8px 4px 4px; border-radius: 0;
  border: 1px solid transparent; border-bottom-color: #2b3a34; color: var(--pf-ink); text-align: left; font-variant-numeric: tabular-nums;
}
#pf-list [data-rank="1"] { --medal: #f1c867; --plate: #393325; --edge: #726240; }
#pf-list [data-rank="2"] { --medal: #d3dce3; --plate: #2c3538; --edge: #566367; }
#pf-list [data-rank="3"] { --medal: #e4a476; --plate: #392e28; --edge: #655044; }
#city-phone #pf-list button:is([data-rank="1"],[data-rank="2"],[data-rank="3"]) {
  min-height: 51px; border: 1px solid var(--edge); border-radius: 11px; background: linear-gradient(95deg,var(--plate),#1c2927 86%); box-shadow: inset 2px 0 var(--medal);
}
.pf-place { justify-self: center; display: grid; place-items: center; color: var(--medal,#a0afa5); font-size: 17px; line-height: 1; }
#pf-list :is([data-rank="1"],[data-rank="2"],[data-rank="3"]) .pf-place {
  position: relative; width: 26px; height: 26px; border: 1px solid var(--medal); border-radius: 50%; color: var(--medal);
}
#pf-list :is([data-rank="1"],[data-rank="2"],[data-rank="3"]) .pf-place::after {
  content: ''; position: absolute; top: 24px; width: 12px; height: 5px; background: var(--medal); clip-path: polygon(0 0,100% 0,82% 100%,50% 70%,18% 100%);
}
.pf-owner { display: grid; gap: 2px; min-width: 0; }
.pf-owner strong, #pf-people strong { overflow-wrap: anywhere; font-size: 14px; line-height: 1.15; }
.pf-owner small { line-height: 1.2; font-size: 11px; color: var(--pf-dim); }
.pf-row-presence { display: inline-block; margin-left: 5px; }
.pf-row-presence::before, #pf-presence.pf-active::before { content: ''; display: inline-block; width: 5px; height: 5px; margin-right: 4px; vertical-align: middle; border-radius: 50%; background: var(--pf-mint); }
.pf-row-level { white-space: nowrap; color: var(--pf-dim); font-size: 11px; }
.pf-row-level b { font-size: 15px; color: var(--pf-ink); }
#city-phone #pf-people button { display: grid; gap: 2px; }
#pf-people small { font-size: 11px; color: var(--pf-dim); }
#pf-pages { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; color: var(--pf-dim); }
#city-phone #pf-pages button { min-width: 44px; min-height: 44px; color: #dceadd; background: #21332c; font-size: 18px; }
#pf-pages button:disabled { opacity: .45; }
#city-phone .pf-action { display: block; width: 100%; min-height: 44px; margin-top: 6px; padding: 6px 8px; border-radius: 11px; background: var(--pf-mint); color: #133021; font-size: 13px; line-height: 1.2; font-weight: 700; }
#city-phone :is(#pf-enable,#pf-invite,#pf-card-retry) { border: 1px solid #3d5247; background: #203329; color: #d5e7d2; }
#city-phone .pf-action:disabled { opacity: .6; }
#pf-cover { display: grid; place-items: center; width: 100%; aspect-ratio: 16 / 9; border-radius: 13px; background: #23312a; }
#pf-preview { grid-area: 1/1; width: 100%; }
#pf-preview canvas { display: block; width: 100%; height: auto; border-radius: 13px; }
#pf-card-status { grid-area: 1/1; padding: 5px; margin: 0; color: #d2decf; text-align: center; font-size: 12px; line-height: 1.4; }
#pf-card:has(#pf-preview canvas) #pf-card-status:not(:empty) { background: #18241eee; border-radius: 7px; }
#pf-card.pf-no-plot #pf-cover, #pf-peer-art { display: none; }
#pf-card.pf-no-plot #pf-peer-art { display: grid; place-items: center; height: 82px; border-radius: 12px; background: linear-gradient(145deg,#3e5d49,#253a32); color: #d4eccb; }
#city-phone #pf-peer-art svg { width: 36px; height: 36px; }
#pf-presence { margin: 7px 0 0; }
#pf-name { margin: 6px 0 2px; font-size: clamp(18px,2vw,25px); line-height: 1.1; letter-spacing: -.025em; overflow-wrap: anywhere; }
#pf-plot { margin: 3px 0 8px; }
#pf-stats { display: flex; margin: 7px 0; padding: 7px 0; border: 1px solid var(--pf-line); border-radius: 10px; background: var(--pf-card); }
#pf-stats > div { flex: 1; padding-left: 10px; }
#pf-stats > div + div { border-left: 1px solid var(--pf-line); }
#pf-stats dt { color: var(--pf-dim); font-size: 11px; }
#pf-stats dd { margin: 1px 0 0; font-size: 19px; font-weight: 700; line-height: 1.1; }
#pf-rank[data-rank="1"] { color: #f1c867; } #pf-rank[data-rank="2"] { color: #d3dce3; } #pf-rank[data-rank="3"] { color: #e4a476; }
@media (max-height: 520px), (max-width: 600px) {
  #city-phone:has(#phone-farm:not([hidden])) .phone-status { display: none; }
  #phone-farm .pf-scroll { padding: 2px 5px 6px; }
  #city-phone :is(#pf-headline,#pf-feed [data-story="berezovka"]) { padding: 7px 9px; }
  #pf-headline strong, #pf-feed [data-story="berezovka"] strong, #pf-article h3 { font-size: 18px; }
  #pf-headline::after, #pf-feed [data-story="berezovka"]::after { width: 17px; height: 17px; right: 5px; bottom: 6px; font-size: 14px; }
  #city-phone .pf-apps button { min-height: 44px; padding: 4px 5px; gap: 5px; font-size: 12px; }
  #city-phone .pf-apps svg { width: 26px; height: 26px; padding: 5px; }
  #city-phone #pf-list button { grid-template-columns: minmax(23px,max-content) minmax(0,1fr) auto; gap: 3px; padding-inline: 3px; }
  #pf-list :is([data-rank="1"],[data-rank="2"],[data-rank="3"]) .pf-place { width: 22px; height: 22px; font-size: 15px; }
  #pf-list :is([data-rank="1"],[data-rank="2"],[data-rank="3"]) .pf-place::after { top: 20px; }
  .pf-place { grid-row: 1 / 3; }
  .pf-owner { display: contents; }
  .pf-owner strong { grid-area: 1 / 2 / 2 / 4; align-self: end; font-size: 12px; }
  .pf-owner small { grid-area: 2 / 2; align-self: start; font-size: 10px; }
  .pf-plot-label { display: none; }
  .pf-row-level { grid-area: 2 / 3; align-self: start; line-height: 1.1; font-size: 10px; }
  .pf-row-level b { font-size: 12px; }
}

/* В низком корпусе отдаём низ трём наградным строкам. Свернуть можно справа от заголовка. */
@media (orientation: landscape) and (max-height: 480px) {
  #city-phone:has(#phone-farm:not([hidden]) #pf-directory:not([hidden])) #phone-pocket {
    position: absolute; top: 0; right: 0; width: 44px; height: 44px;
  }
  #city-phone:has(#phone-farm:not([hidden]) #pf-directory:not([hidden])) #phone-pocket span { display: none; }
  #city-phone:has(#phone-farm:not([hidden]) #pf-directory:not([hidden])) #phone-pocket svg { display: block; width: 16px; }
  #phone-app:has(#phone-farm:not([hidden]) #pf-directory:not([hidden])) > header { padding-inline: 0 44px; gap: 0; }
  #pf-directory #pf-sort { display: none; }
  #pf-list:not(:empty) { margin-top: 3px; }
  #pf-list > li + li { margin-top: 2px; }
  #city-phone #pf-list button:is([data-rank="1"],[data-rank="2"],[data-rank="3"]) { min-height: 44px; padding-block: 2px; }
}
@container (max-width: 159px) {
  #phone-app-name:has(.pf-title-detail) { font-size: 11px; }
  .pf-title-detail { display: none; }
}

#pf-offer {
  width: min(235px,100%); padding: 9px; border: 1px solid #b5cda3; border-radius: 10px;
  background: #233c31f5; color: #fffbe8; pointer-events: auto; box-shadow: 0 4px 12px #0004;
}
#pf-offer p { margin: 0 0 4px; overflow-wrap: anywhere; font-size: 13px; }
#pf-offer div { display: flex; flex-wrap: wrap; gap: 4px; }
#city-hud #pf-offer button {
  cursor: pointer; border: 0; min-height: 44px; border-radius: 7px; padding: 4px 9px;
  color: #203d28; background: #d3e3c1; font: 650 13px/1.2 Arial,sans-serif;
}
#city-hud #pf-offer #pf-decline { color: #f1f0dc; background: #435847; }
#pf-meeting { margin: 0 0 10px; }
#pf-meeting-name { font-size: 13px; overflow-wrap: anywhere; }
.pf-visit-note {
  position: absolute; top: max(64px,calc(env(safe-area-inset-top) + 52px)); right: max(12px,env(safe-area-inset-right));
  max-width: min(250px,40vw); margin: 0; padding: 6px 9px; border-radius: 8px;
  font: 600 13px/1.3 Arial,sans-serif; color: #fffbe8; background: #233c31f5; pointer-events: none;
}
[data-farm-picker] { display: grid; gap: 6px; }
[data-farm-picker] input {
  box-sizing: border-box; width: 100%; min-height: 44px; padding: 6px 9px; border: 1px solid var(--pf-line);
  border-radius: 9px; background: var(--pf-card); color: var(--pf-ink); font: inherit;
}
[data-farm-picker] ul { padding: 0; margin: 0; list-style: none; }
#city-phone [data-farm-picker] li button {
  display: flex; justify-content: space-between; align-items: center; gap: 6px; width: 100%; min-height: 44px;
  padding: 6px; border: 0; border-bottom: 1px solid var(--pf-line); color: var(--pf-ink);
  background: var(--pf-card); font: inherit; text-align: left; overflow-wrap: anywhere;
}
[data-farm-picker] li small { color: var(--pf-mint); }
[data-farm-picker] p { margin: 0; color: var(--pf-dim); font-size: 12px; }
[data-farm-picker] p:empty { display: none; }
@media (max-height: 520px), (max-width: 600px) {
  #city-phone :is(#pf-invite,#pf-visit) { width: 100%; padding: 4px; font-size: 11px; }
  #pf-offer { padding: 5px; }
  #pf-offer p { font-size: 11px; }
  #city-hud #pf-offer button { padding: 3px 5px; font-size: 11px; }
}
