#dialog:is([data-kind="birdwatch-brief"], [data-kind="birdwatch-result"]) {
  width: min(744px, calc(100vw - var(--phone-left, 16px) - var(--phone-right, 16px)));
  background: #f7f4e6;
  color: #254442;
  border-color: #325d53;
}

.bird-panel-heading h2 { color: #264b45; padding-inline-end: 44px; }
.dialog-content .bird-panel-heading p { margin: 1px 38px 11px 0; color: #405c52; font-size: 13px; line-height: 1.42; }
.bird-field-guide { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.bird-field-card {
  --bird-border: #73988a;
  --bird-paper: #e6efe4;
  --bird-sky: #b4d7cb;
  --bird-water: #76a6a3;
  display: grid;
  grid-template-columns: 87px minmax(0,1fr);
  gap: 9px;
  min-width: 0;
  padding: 6px;
  background: var(--bird-paper);
  border: 1px solid var(--bird-border);
  border-radius: 8px;
}
.bird-field-card[data-bird="wader"] {
  --bird-border: #ab9872;
  --bird-paper: #f1e8d3;
  --bird-sky: #d8dec0;
  --bird-water: #ad9d78;
}
.bird-plate {
  display: grid;
  min-height: 88px;
  align-content: end;
  justify-items: center;
  overflow: hidden;
  padding-block-end: 4px;
  border: 1px solid var(--bird-border);
  border-radius: 5px;
  background: linear-gradient(var(--bird-sky) 65%, var(--bird-water) 65%, var(--bird-sky));
}
.bird-plate > span:not(.bird-specimen) { color: #234745; font-size: 11px; font-weight: 850; }
.bird-specimen { position: relative; display: block; width: 64px; height: 51px; }
.bird-specimen > * { position: absolute; display: block; }
.bird-specimen[data-bird="dipper"] i { inset: 43% 25% 22% 27%; background: #388a83; box-shadow: inset 0 -6px #cc895c; }
.bird-specimen[data-bird="dipper"] b { inset: 23% 19% 48% 49%; background: #45958b; box-shadow: inset 0 4px #75b39d; }
.bird-specimen[data-bird="dipper"] b::after {
  content: ""; position: absolute; top: 39%; right: 20%; width: 18%; aspect-ratio: 1; background: #172e36;
}
.bird-specimen[data-bird="dipper"] .bird-bill { inset: 36% 1% 55% 80%; background: #385049; }
.bird-specimen[data-bird="dipper"] small { inset: 59% 72% 28% 7%; transform: rotate(-19deg); background: #2b706e; }
.bird-specimen[data-bird="wader"] i { inset: 45% 32% 34% 17%; background: #eee8cd; box-shadow: inset 0 -4px #bfaa85; }
.bird-specimen[data-bird="wader"] b { inset: 22% 29% 42% 60%; background: #eee8cd; transform: rotate(14deg); }
.bird-specimen[data-bird="wader"] b::after {
  content: ""; position: absolute; top: -15%; right: -22%; width: 210%; height: 46%;
  background: linear-gradient(to right,#f6e8c8 60%,#433f40 60%,#433f40 76%,#e6d5bb 76%);
}
.bird-specimen[data-bird="wader"] .bird-bill { inset: 21% 1% 71% 69%; background: #ab523f; }
.bird-specimen[data-bird="wader"] small {
  inset: 61% 44% 6% 52%;
  background: #744d48;
  box-shadow: -8px 2px #744d48;
  transform: rotate(9deg);
}
.bird-field-copy { align-self: center; min-width: 0; padding-inline-end: 3px; }
.bird-field-copy h3 { margin: 0; color: #294942; font-size: 17px; line-height: 1.16; font-weight: 950; }
.bird-field-copy > strong { display: block; margin-top: 3px; color: #455b49; font-size: 12px; }
.dialog-content .bird-field-copy p { margin: 5px 0 0; color: #46574d; font-size: 12px; line-height: 1.38; }
.bird-field-copy > small { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 11px; font-weight: 820; }
.bird-field-copy > small .glyph, .bird-tally .glyph { width: 14px; height: 14px; color: #4b7460; }
.bird-panel-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #a3b4a1;
}
.dialog-content .bird-panel-foot > p { margin: 0; color: #415d52; font-size: 12px; line-height: 1.4; }
.bird-panel-actions { display: flex; flex: none; align-items: center; gap: 4px; }
.bird-panel-actions button, #dialog[data-kind="birdwatch-result"] .result-activity-link { min-width: 44px; min-height: 44px; padding-inline: 11px; }
.bird-tally { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; }
.bird-tally span { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
#dialog[data-kind="birdwatch-result"] .dialog-content { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; align-items: end; }
#dialog[data-kind="birdwatch-result"] :is(.bird-panel-heading, .bird-field-guide) { grid-column: 1 / -1; }
#dialog[data-kind="birdwatch-result"] .bird-panel-foot { margin: 0; border: 0; padding: 0; }
#dialog[data-kind="birdwatch-result"] .result-activity-footer { margin: 0; border: 0; padding: 0; }

#birdwatch-hud {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 4px;
  width: min(100%, 280px);
}
#birdwatch-hud[hidden] { display: none; }
.bird-hud-row {
  --bird-status: #a5e0c8;
  display: grid;
  grid-template-columns: 27px minmax(0,1fr);
  align-items: center;
  gap: 3px;
  padding: 3px 4px;
  background: #173d46f2;
  color: #f9f7e5;
  border: 1px solid #a7c6b581;
  border-radius: 7px;
}
.bird-hud-row[data-bird="wader"] { --bird-status: #efcf92; }
.bird-hud-row[data-ready], .bird-hud-row[data-marked] { border-color: var(--bird-status); }
.bird-hud-row .bird-specimen { width: 29px; height: 24px; }
.bird-hud-row .bird-specimen[data-bird="dipper"] i { box-shadow: inset 0 -3px #cc895c; }
.bird-hud-row .bird-specimen[data-bird="dipper"] b { box-shadow: inset 0 2px #75b39d; }
.bird-hud-row .bird-specimen[data-bird="wader"] i { box-shadow: inset 0 -2px #bfaa85; }
.bird-hud-row .bird-specimen[data-bird="wader"] small { box-shadow: -3px 1px #744d48; }
.bird-hud-row > div { display: grid; gap: 1px; min-width: 0; }
.bird-hud-row b { color: var(--bird-status); font-size: 11px; line-height: 1.16; white-space: nowrap; }
.bird-hud-row div span { font-size: 10px; line-height: 1.16; }
.bird-hud-row div > i { height: 2px; margin-top: 2px; background: var(--bird-status); transform: scaleX(var(--bird-watch, 0)); transform-origin: left; }
.bird-hud-row[data-marked] div > i { transform: scaleX(1); }

@media (orientation: landscape) and (max-height: 400px) {
  #dialog:is([data-kind="birdwatch-brief"], [data-kind="birdwatch-result"]) .dialog-content { padding: 10px 14px; }
  .bird-panel-heading h2 { margin-bottom: 3px; font-size: 25px; line-height: 1.07; }
  .dialog-content .bird-panel-heading p { margin-bottom: 7px; font-size: 12px; }
  .bird-field-guide { gap: 6px; }
  .bird-field-card { grid-template-columns: 60px minmax(0,1fr); gap: 7px; padding: 5px; }
  .bird-plate { min-height: 69px; }
  .bird-plate .bird-specimen { width: 53px; height: 40px; }
  .bird-field-copy h3 { font-size: 15px; }
  .dialog-content .bird-field-copy p, .dialog-content .bird-panel-foot > p { font-size: 11px; }
  .bird-panel-foot { margin-top: 5px; padding-top: 5px; }
  .bird-panel-actions button, #dialog[data-kind="birdwatch-result"] .result-activity-link { padding-inline: 7px; }
  #birdwatch-hud { width: min(100%, 235px); }
}

@media (orientation: portrait) and (max-width: 500px) {
  #dialog[data-kind="birdwatch-result"] .dialog-content { grid-template-columns: minmax(0,1fr); }
  .bird-field-guide { grid-template-columns: 1fr; }
  .bird-field-card { grid-template-columns: 74px minmax(0,1fr); }
  .bird-panel-foot { flex-wrap: wrap; }
  #birdwatch-hud { width: min(100%, 280px); }
}
