.harvest-invite {
  display: grid;
  grid-template-columns: 79px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  min-height: 66px;
  margin-bottom: 13px;
  padding: 5px 15px 6px 8px;
  border: 1px solid #476271;
  border-radius: 12px;
  color: #fff3d4;
  background: radial-gradient(ellipse at 9% 100%, #46777c, transparent 40%), linear-gradient(110deg, #263f51, #202e40 78%);
  box-shadow: 0 3px #192b36;
  text-align: left;
}
.harvest-invite:hover:not(:disabled) { border-color: #a28a5f; }
.harvest-emblem { display: block; width: 100%; height: auto; }
.harvest-invite-copy { display: grid; gap: 3px; }
.harvest-invite-copy strong { font-size: clamp(18px, 2.8vw, 24px); font-weight: 950; line-height: 1.16; }
.harvest-invite-copy small { color: #c0dbda; font-size: 12px; font-weight: 700; line-height: 1.38; }
.harvest-invite-go { display: flex; gap: 6px; align-items: center; color: #ffda9c; font-size: 13px; font-weight: 850; }
.harvest-invite-go .glyph { width: 18px; height: 18px; }

#dialog:is([data-kind="harvest-guide"], [data-kind="harvest-result"]) {
  width: min(720px, 95vw, calc(100% - var(--phone-left, 0px) - var(--phone-right, 0px)));
  color: #253d43;
  background: #faf7ec;
  border-color: #354b50;
  box-shadow: 0 6px #354b50, 0 18px 60px #172a3d70;
}
#dialog:is([data-kind="harvest-guide"], [data-kind="harvest-result"]) .dialog-content { padding: clamp(15px, 3.2vw, 26px); }
#dialog[data-kind="harvest-guide"] .dialog-close { min-width: 44px; min-height: 44px; color: #36545d; background: #f0eee3; border-color: #858c80; }
.harvest-brief-head { display: grid; gap: 4px; margin: 0 48px 13px 0; }
.harvest-brief-head > span { color: #4b6766; font-size: 12px; line-height: 1.1; font-weight: 850; }
.dialog-content .harvest-brief-head h2 { margin: 0; color: #203a40; font-size: clamp(28px, 4.5vw, 40px); line-height: 1.12; letter-spacing: -.045em; }
.harvest-brief-body { display: grid; grid-template-columns: 1.14fr 1fr; gap: clamp(12px, 2.7vw, 21px); align-items: stretch; }
.harvest-survey {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 5px;
  min-width: 0;
  margin: 0;
  padding: 11px 12px;
  overflow: hidden;
  border: 1px solid #364e5c;
  border-radius: 12px;
  color: #edf4e4;
  background-color: #203744;
  background-image: linear-gradient(#adc9b308 1px, transparent 1px), linear-gradient(90deg, #adc9b308 1px, transparent 1px), radial-gradient(ellipse at 45% 55%, #3a6569, #1c303e 73%);
  background-size: 15px 15px, 15px 15px, auto;
}
.harvest-survey figcaption { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 13px; }
.harvest-survey figcaption b { color: #f5e8c8; }
.harvest-survey figcaption span { color: #bcd3cf; font-size: 11px; }
.harvest-survey-map { display: block; align-self: center; justify-self: center; width: 100%; max-height: 120px; }
.harvest-map-key { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 4px 8px; padding-top: 6px; border-top: 1px solid #abc8c135; }
.harvest-map-key > span { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1.3; }
.harvest-map-key b { color: #f7eaca; font-size: inherit; }
.harvest-map-key small { color: #cfdbd7; font-size: 10px; }
.harvest-ore { width: 7px; height: 9px; flex: none; clip-path: polygon(50% 0, 100% 38%, 83% 77%, 45% 100%, 0 75%, 0 38%); background: #75e0cf; }
.harvest-ore[data-yield="2"] { background: #f29b8b; }
.harvest-ore[data-yield="3"] { background: #bec0ff; }
.harvest-bank-key { width: 7px; height: 9px; background: #ffd187; box-shadow: inset -2px 0 #c98d54; }
.harvest-lift-key { width: 9px; height: 7px; border: 1px solid #d2f8ff; border-top-width: 2px; border-radius: 2px; background: #68bac8; }
.harvest-shifts { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.harvest-shifts h3 { margin: 0 0 7px; font-size: 15px; }
.harvest-choices { display: grid; gap: 7px; }
.harvest-shift { display: flex; align-items: center; gap: 9px; min-height: 44px; padding: 7px 10px; border: 1px solid #b8beb1; border-radius: 9px; background: #fffdf3; color: #354a4d; text-align: left; }
.harvest-shift:hover { background: #f1f2e4; }
.harvest-shift[aria-pressed="true"] { border-color: #4c8579; background: #e2efdf; box-shadow: inset 2px 0 #357c6c; }
.harvest-radio { width: 13px; height: 13px; flex: none; border: 1.5px solid #7f8c82; border-radius: 50%; }
.harvest-shift[aria-pressed="true"] .harvest-radio { border: 4px solid #367867; background: #f9f5d8; }
.harvest-shift > span:last-child { min-width: 0; display: grid; gap: 3px; }
.harvest-shift strong { font-size: 16px; line-height: 1.1; }
.harvest-shift small { color: #50635d; font-size: 12px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.dialog-content .harvest-shifts p { margin: 9px 0 0; font-size: 12px; line-height: 1.5; color: #4e5d59; }
.harvest-start { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 13px; padding-top: 12px; border-top: 1px solid #c3c5b8; }
.dialog-content .harvest-start p { margin: 0; font-size: 13px; line-height: 1.45; color: #334e4e; }
.harvest-start p span { display: block; color: #586962; font-size: 12px; }
.harvest-start kbd { font: 800 12px/1 ui-monospace, monospace; }
.harvest-start button, .harvest-result-actions button { min-height: 44px; flex: none; }
.harvest-start .primary, .harvest-result-actions .primary { background: #ffdc96; color: #3c372c; border-color: #655036; box-shadow: 0 3px #795d3c; }

.harvest-key, #harvest-hud { display: none; }
#app[data-harvest="true"] .harvest-key { display: inline; }
#app[data-harvest="true"] #race :is(#arena-round, #arena-score, #arena-coach, #arena-star-guide) { display: none; }
#app[data-harvest="true"] #race #interact { display: grid; }
#app[data-harvest="true"] #race .race-top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; }
#app[data-harvest="true"] .race-place { justify-self: start; max-width: 100%; }
#app[data-harvest="true"] #harvest-hud { display: grid; justify-items: center; align-content: start; gap: 4px; min-width: 0; pointer-events: none; }
.harvest-board { display: flex; align-items: center; min-height: 43px; padding: 5px 2px; border: 1px solid #9dbaa9; border-radius: 10px; background: #1e3440ef; color: #f6f4dc; box-shadow: 0 2px #152733; }
.harvest-board > div { display: grid; align-content: center; gap: 3px; padding: 0 11px; }
.harvest-board > div + div { border-left: 1px solid #afc6b64f; }
.harvest-board small { display: block; color: #d0dad0; font-size: 11px; line-height: 1; font-weight: 750; }
.harvest-bank-stat strong, .harvest-clock strong { font: 850 17px/1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.harvest-bank-stat b { color: #ffdc95; }
.harvest-bank-stat strong span { color: #eff2d8; font-size: 12px; }
.harvest-board .harvest-lift-stat[hidden] { display: none; }
.harvest-lift-stat b { color: #a9eafa; font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.harvest-bag-stat small b { color: #eff3dd; font-size: 10px; font-variant-numeric: tabular-nums; }
.harvest-slots { display: flex; gap: 3px; height: 16px; align-items: center; }
.harvest-slots i { width: 8px; height: 11px; border: 1px solid #b6c9c0; transform: skewY(-10deg); background: #405660; }
.harvest-slots i[data-filled] { background: #9de8cd; border-color: #dafbe3; box-shadow: inset -2px -2px #6cae9d; }
#harvest-hud[data-urgent] .harvest-clock strong { color: #ffc29e; }
.harvest-cue { width: max-content; max-width: 100%; padding: 3px 8px; color: #f3efd6; background: #243d46eb; border: 1px solid #839c9580; border-radius: 6px; text-align: center; font-size: 12px; line-height: 1.35; font-weight: 750; }
.harvest-cue[data-kind="warning"], .harvest-cue[data-kind="drop"] { background: #633f38f2; border-color: #e1a786; color: #ffead6; }
.harvest-cue[data-kind="bank"] { background: #30544feb; border-color: #a6c4a3; color: #fff0b9; }
.harvest-cue[data-kind="lift"] { background: #254e65f0; border-color: #9bdbe5; color: #c6f4ff; }

.harvest-navigation {
  position: absolute; left: 0; top: 54px; width: max-content; max-width: 100%;
  display: grid; gap: 4px; padding: 6px; border: 1px solid #8aaba6; border-radius: 8px;
  color: #e3f1dc; background: #203b45f5; box-shadow: 0 2px #12263088; text-align: left;
}
.harvest-navigation[hidden] { display: none; }
.harvest-navigation header { display: flex; align-items: center; gap: 6px; line-height: 1.2; }
.harvest-navigation header b { font-size: 13px; letter-spacing: .045em; }
.harvest-north { font-size: 10px; color: #cfdfd4; }
.harvest-change { margin-left: auto; border-radius: 3px; color: #d7e9d5; font-size: 11px; font-weight: 750; font-variant-numeric: tabular-nums; }
.harvest-navigation[data-warning] .harvest-change { color: #ffe0a7; background: #654633; padding-inline: 3px; outline: 1px solid #ad8660; }
.harvest-nav-body { display: grid; grid-template-columns: 92px auto; gap: 6px; align-items: center; }
.harvest-live-map { display: block; width: 100%; height: auto; background: #192f39; border: 1px solid #728e88; border-radius: 4px; }
.harvest-floor { fill: #547571; stroke: #73908a; stroke-width: .6; }
.harvest-floor[data-state="warning"] { fill: url(#harvest-hatch); stroke: #e5ae7c; }
.harvest-floor[data-state="off"] { fill: #223c46; stroke: none; }
.harvest-floor[data-state="returning"] { fill: #243e47; stroke: #97ceb5; stroke-width: 1.1; stroke-dasharray: 3.4 2.6; }
.harvest-path { fill: none; stroke: #b9ffdc; stroke-width: 3.5; stroke-linecap: round; }
.harvest-path.at-risk { stroke: #ffcc91; stroke-dasharray: 3 3; }
.harvest-pin-frame { fill: none; stroke: #fff7cf; stroke-width: 1.1; }
.harvest-bank-mark { fill: #ffd184; stroke: #3e443e; stroke-width: .8; }
.harvest-lift-mark { fill: #8de0ee; stroke: #cef9ff; stroke-width: 1.15; stroke-linecap: round; stroke-linejoin: round; }
.harvest-lift-route { fill: none; stroke: #86dceb; stroke-width: 1.1; stroke-dasharray: 2.7 2.2; }
.harvest-seam-mark { fill: #96e4d6; stroke: #33444d; stroke-width: .8; }
.harvest-pin-mark[data-pin="prism"] .harvest-seam-mark { fill: #f6b29c; }
.harvest-pin-mark[data-pin="core"] .harvest-seam-mark { fill: #cbcaff; }
.harvest-pin-mark[data-quiet] .harvest-seam-mark { fill: #445663; stroke: #9aaeb1; }
.harvest-pin-mark[data-quiet] .harvest-lift-mark { fill: #455c66; stroke: #91aab2; }
.harvest-pin-mark text { text-anchor: middle; fill: #293c46; font: 800 8px/1 system-ui,sans-serif; }
.harvest-pin-mark[data-quiet] text { fill: #d3dedc; }
.harvest-map-player { fill: #fffdf1; stroke: #1e3543; stroke-width: 1.4; }
.harvest-targets { display: grid; grid-template-columns: repeat(3,minmax(44px,1fr)); gap: 3px; }
.harvest-targets button {
  display: grid; place-content: center; justify-items: center; min-width: 48px; min-height: 44px; gap: 2px;
  padding: 2px 4px; border: 1px solid #788f8e; border-radius: 5px; box-shadow: none;
  color: #eef0da; background: #344e55; pointer-events: auto; touch-action: manipulation;
}
.harvest-targets button strong { font-size: 13px; line-height: 1.1; }
.harvest-targets button small { color: #d5dfd3; font-size: 10px; font-weight: 650; line-height: 1.05; }
.harvest-targets button[data-target="beacon"] strong { color: #ffda9e; }
.harvest-targets button[data-target="lift"] strong { color: #9ae9f7; }
.harvest-targets button[data-target="shallow"] strong { color: #a8efdc; }
.harvest-targets button[data-target="prism"] strong { color: #ffc2ac; }
.harvest-targets button[data-target="core"] strong { color: #dbd9ff; }
.harvest-targets button:is([data-target="shallow"],[data-target="prism"],[data-target="core"]) strong::before {
  display: inline-grid; place-content: center; width: 10px; height: 12px; margin-right: 2px;
  font: 800 9px/1 system-ui,sans-serif; border: 1px solid currentColor; border-radius: 4px 4px 3px 3px;
}
.harvest-targets button[data-target="shallow"] strong::before { content: '1'; }
.harvest-targets button[data-target="prism"] strong::before { content: '2'; }
.harvest-targets button[data-target="core"] strong::before { content: '3'; }
.harvest-targets button[aria-pressed="true"] { border-color: #fff1b8; background: #54695f; box-shadow: inset 0 0 0 1px #fff1b8; }
.harvest-targets button:focus-visible { outline: 2px solid #fff6be; outline-offset: 1px; }
.harvest-route-caption { display: flex; align-items: center; gap: 4px; font-size: 10px; line-height: 1.2; color: #e0eada; }
.harvest-route-caption i { width: 6px; height: 6px; border-radius: 50%; background: #fffdf1; flex: none; }

@media (max-width: 600px) and (orientation: portrait) {
  .harvest-navigation { top: 91px; }
}
@media (orientation: landscape) and (max-height: 440px) {
  .harvest-navigation { top: 45px; gap: 3px; padding: 4px; }
  .harvest-nav-body { grid-template-columns: 78px auto; gap: 4px; }
  .harvest-targets button { min-width: 44px; }
}

#dialog[data-kind="harvest-result"] { width: min(94vw, 480px); }
.harvest-receipt { display: flex; justify-content: space-between; align-items: center; min-height: 79px; padding: 10px 15px; border-radius: 11px; color: #e2ebd9; background: radial-gradient(ellipse at bottom right, #4d7477, transparent 62%), #243f48; }
.harvest-receipt > div { display: grid; gap: 3px; }
.harvest-receipt span { color: #d0e3ce; font-size: 12px; font-weight: 800; }
.harvest-receipt strong { color: #ffdd99; font: 900 35px/1.1 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
.harvest-receipt small { color: #e2e6cd; font-size: 15px; }
.harvest-receipt .harvest-emblem { width: 86px; }
.dialog-content .harvest-result-detail { margin: 10px 0; color: #3e5756; }
.harvest-results-stats { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,110px),1fr)); gap: 8px; margin: 0; }
.harvest-results-stats > div { padding: 8px 10px; border: 1px solid #c4cbbd; border-radius: 8px; background: #eef0e4; }
.harvest-results-stats dt { color: #536760; font-size: 12px; }
.harvest-results-stats dd { margin: 2px 0 0; color: #304a49; font-weight: 850; font-variant-numeric: tabular-nums; }
.dialog-content .harvest-reward { display: flex; align-items: center; gap: 5px; margin: 11px 0 0; color: #695732; font-size: 13px; }
.harvest-reward .glyph { width: 17px; height: 17px; }
.harvest-result-actions { gap: 7px; }
.harvest-result-actions button { font-size: 13px; padding-inline: 10px; }

@media (max-width: 600px) and (orientation: portrait) {
  #app[data-harvest="true"] #race .race-top { grid-template-columns: minmax(0, 1fr) auto; }
  #app[data-harvest="true"] #race .race-place { display: none; }
  #app[data-harvest="true"] #harvest-hud { justify-items: start; }
  .harvest-board > div { padding-inline: 8px; }
  .harvest-cue { font-size: 11px; }
  .harvest-invite { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 8px; padding: 6px 8px 6px 4px; }
  .harvest-invite-copy small { font-size: 11px; }
  .harvest-brief-body { grid-template-columns: 1fr; gap: 13px; }
  .harvest-survey { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); padding: 9px 10px; gap: 3px 6px; }
  .harvest-survey figcaption { grid-column: 1 / -1; }
  .harvest-survey-map { grid-row: 2; min-height: 75px; }
  .harvest-map-key { display: flex; flex-direction: column; justify-content: center; gap: 5px; padding: 0 0 0 8px; border: 0; border-left: 1px solid #abc8c135; }
  .harvest-choices { grid-template-columns: 1fr 1fr; }
  .harvest-shift { padding: 8px; gap: 6px; }
  .harvest-shift small { font-size: 11px; }
  .harvest-start { flex-wrap: wrap; gap: 9px; }
  .harvest-start .primary { width: 100%; }
}
@media (orientation: landscape) and (max-height: 440px) {
  #dialog:is([data-kind="harvest-guide"], [data-kind="harvest-result"]) .dialog-content { padding: 11px 15px 14px; }
  .harvest-brief-head { gap: 2px; margin-bottom: 8px; }
  .dialog-content .harvest-brief-head h2 { font-size: 27px; }
  .harvest-survey { padding: 7px 10px; gap: 2px; }
  .harvest-survey-map { max-height: 96px; }
  .harvest-shifts h3 { margin-bottom: 4px; font-size: 13px; }
  .harvest-choices { gap: 4px; }
  .harvest-shift { padding: 4px 9px; }
  .dialog-content .harvest-shifts p { margin-top: 5px; }
  .harvest-start { margin-top: 8px; padding-top: 7px; }
  .harvest-invite { grid-template-columns: 52px 1fr auto; min-height: 50px; margin-bottom: 9px; padding-block: 3px; }
  .harvest-invite-copy { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
  .harvest-invite-copy strong { font-size: 18px; }
  .harvest-board { min-height: 38px; padding-block: 3px; }
  .harvest-board > div { padding-inline: 7px; }
  .harvest-cue { padding-block: 2px; }
  .harvest-receipt { min-height: 58px; padding-block: 6px; }
  .harvest-receipt .harvest-emblem { width: 67px; }
  .harvest-results-stats > div { display: flex; justify-content: space-between; align-items: center; }
}

@media (orientation: landscape) and (max-height: 340px) {
  #dialog[data-kind="harvest-guide"] .dialog-content { padding: 8px 12px 4px; }
  #dialog[data-kind="harvest-guide"] .dialog-close { top: 9px; right: 10px; }
  .harvest-brief-head { gap: 1px; margin-bottom: 5px; }
  .harvest-brief-head > span { font-size: 10px; }
  .dialog-content .harvest-brief-head h2 { font-size: 24px; line-height: 1.1; }
  .harvest-brief-body { gap: 10px; }
  .harvest-survey { padding: 5px 7px; }
  .harvest-survey-map { max-height: 70px; }
  .harvest-map-key { gap: 2px 5px; padding-top: 3px; }
  .harvest-shifts h3 { margin-bottom: 3px; }
  .dialog-content .harvest-shifts p { font-size: 11px; line-height: 1.35; }
  .harvest-start { margin-top: 5px; padding-top: 5px; }
  .dialog-content .harvest-start p, .harvest-start p span { font-size: 11px; line-height: 1.3; }
}
