:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #f4f4e9;
  --muted: #b9c8bf;
  --panel: rgba(18, 33, 35, .94);
  --panel-soft: rgba(27, 47, 46, .9);
  --line: rgba(255, 255, 255, .16);
  --green: #a8cb63;
  --yellow: #edc45a;
  --red: #d9534f;
  --cyan: #65c4ce;
  --soil: #79563c;
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  background: #183840;
  color: var(--ink);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
#farmCanvas:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

#farmCanvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  background: #183840;
}

.loading-screen strong {
  font-size: clamp(1.3rem, 5vw, 2.4rem);
}

.loading-screen small,
.farm-title small,
.hud-stat small,
.weather-stat small,
.dock-heading,
.panel-heading,
.inventory-section header,
.settings-dialog header small {
  color: var(--muted);
  font-size: .66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.loading-mark {
  width: 36px;
  height: 36px;
  border: 4px solid rgba(255, 255, 255, .15);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.top-hud {
  position: fixed;
  z-index: 20;
  top: max(14px, env(safe-area-inset-top));
  left: max(14px, env(safe-area-inset-left));
  right: max(14px, env(safe-area-inset-right));
  display: grid;
  grid-template-columns: 42px minmax(170px, 1fr) minmax(92px, 126px) 105px minmax(150px, 190px) 42px;
  align-items: stretch;
  min-height: 58px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(16, 30, 32, .9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .22);
  backdrop-filter: blur(10px);
}

.home-button,
.icon-button {
  display: grid;
  place-items: center;
  min-width: 42px;
  border: 0;
  background: rgba(255, 255, 255, .05);
  text-decoration: none;
  font-size: 1.18rem;
  font-weight: 900;
}

.home-button:hover,
.icon-button:hover {
  background: rgba(255, 255, 255, .13);
}

.farm-title,
.hud-stat,
.weather-stat {
  display: flex;
  min-width: 0;
  padding: 9px 13px;
  border-left: 1px solid var(--line);
}

.farm-title {
  flex-direction: column;
  justify-content: center;
}

.farm-title strong {
  overflow: hidden;
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hud-stat {
  position: relative;
  flex-direction: column;
  justify-content: center;
}

.hud-stat strong {
  font-size: 1.12rem;
}

.level-stat i {
  position: absolute;
  right: 10px;
  bottom: 7px;
  left: 10px;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
}

.level-stat i b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--yellow);
  transition: width .25s ease;
}

.weather-stat {
  align-items: center;
  gap: 10px;
}

.weather-stat > span {
  font-size: 1.45rem;
}

.weather-stat div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.weather-stat strong {
  overflow: hidden;
  font-size: .78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.task-prompt {
  position: fixed;
  z-index: 12;
  top: max(86px, calc(env(safe-area-inset-top) + 74px));
  left: max(18px, env(safe-area-inset-left));
  padding: 9px 13px;
  border-left: 4px solid var(--yellow);
  background: rgba(21, 38, 37, .86);
  box-shadow: 0 9px 22px rgba(0, 0, 0, .2);
  font-size: .76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.camera-controls {
  position: fixed;
  z-index: 14;
  bottom: max(126px, calc(env(safe-area-inset-bottom) + 112px));
  left: max(18px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: repeat(3, 42px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(16, 30, 32, .88);
  box-shadow: 0 9px 24px rgba(0, 0, 0, .24);
  backdrop-filter: blur(8px);
}

.camera-controls button {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  font-size: 1.15rem;
  font-weight: 900;
}

.camera-controls button:last-child {
  border-right: 0;
}

.camera-controls button:hover {
  background: rgba(255, 255, 255, .12);
}

.management-panel {
  position: fixed;
  z-index: 18;
  top: max(86px, calc(env(safe-area-inset-top) + 74px));
  right: max(14px, env(safe-area-inset-right));
  bottom: max(14px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr);
  width: min(360px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 18px 46px rgba(0, 0, 0, .3);
  backdrop-filter: blur(12px);
}

.panel-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
}

.panel-tabs > button {
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: .69rem;
  font-weight: 900;
}

.panel-tabs > button[aria-selected="true"] {
  background: rgba(168, 203, 99, .13);
  color: var(--ink);
  box-shadow: inset 0 -3px var(--green);
}

.panel-tabs button span {
  display: inline-grid;
  min-width: 19px;
  min-height: 19px;
  margin-left: 4px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: white;
  font-size: .62rem;
}

.panel-tabs .panel-close {
  display: none;
}

.panel-view {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 15px 8px;
}

.panel-heading small {
  max-width: 170px;
  color: var(--muted);
  font-size: .63rem;
  text-align: right;
  text-transform: none;
}

.contract-progress {
  display: grid;
  gap: 7px;
  margin: 3px 10px 7px;
  padding: 10px 11px;
  border-left: 3px solid var(--yellow);
  background: rgba(237, 196, 90, .07);
}

.contract-progress.complete {
  border-left-color: var(--green);
  background: rgba(168, 203, 99, .09);
}

.contract-progress header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: .66rem;
  font-weight: 950;
}

.contract-progress p {
  margin: 0;
  color: var(--muted);
  font-size: .66rem;
}

.contract-meter {
  height: 6px;
  overflow: hidden;
  background: rgba(255, 255, 255, .11);
}

.contract-meter b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--yellow);
  transition: width .28s ease;
}

.contract-progress.complete .contract-meter b {
  background: var(--green);
}

.order-list,
.upgrade-list {
  display: grid;
  gap: 8px;
  padding: 5px 10px 12px;
}

.order-item,
.upgrade-item {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, .035);
}

.order-item.ready {
  border-color: rgba(168, 203, 99, .6);
  background: rgba(168, 203, 99, .08);
}

.order-item.priority:not(.ready) {
  border-left: 3px solid var(--cyan);
}

.order-finished {
  display: grid;
  min-height: 92px;
  place-content: center;
  gap: 5px;
  border: 1px dashed rgba(168, 203, 99, .5);
  color: var(--green);
  text-align: center;
}

.order-finished strong {
  font-size: .72rem;
}

.order-finished small {
  color: var(--muted);
  font-size: .65rem;
}

.order-head,
.order-reward,
.upgrade-head,
.upgrade-action,
.inventory-section header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.order-head span,
.upgrade-head span {
  color: var(--muted);
  font-size: .65rem;
  font-weight: 900;
}

.order-head strong,
.upgrade-head strong {
  font-size: .86rem;
}

.order-crops {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.produce-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, .11);
  background: rgba(0, 0, 0, .16);
  font-size: .68rem;
  font-weight: 800;
}

.produce-chip i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--crop-color);
}

.produce-chip.missing {
  color: #f1a29c;
}

.order-reward small,
.upgrade-action small,
.upgrade-item p {
  margin: 0;
  color: var(--muted);
  font-size: .68rem;
}

.order-item button,
.upgrade-item button,
.seed-button,
.mobile-panel-button {
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 4px;
  background: var(--green);
  color: #182018;
  font-size: .68rem;
  font-weight: 950;
}

button:disabled {
  cursor: default;
  opacity: .43;
}

.inventory-section {
  padding: 12px 15px max(16px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.storage-meter {
  height: 5px;
  margin: 7px 0 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, .1);
}

.storage-meter b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
  transition: width .2s ease;
}

.inventory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.inventory-row {
  display: grid;
  grid-template-columns: 9px 1fr auto auto;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  font-size: .65rem;
}

.inventory-row > i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crop-color);
}

.inventory-row button {
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 255, 255, .06);
  font-size: .75rem;
}

.upgrade-item.locked {
  opacity: .58;
}

.upgrade-item.with-art {
  position: relative;
  min-height: 112px;
  padding-left: 78px;
}

.upgrade-art {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 58px;
  height: 66px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .35));
  transform: translateY(-50%);
}

.upgrade-levels {
  display: flex;
  gap: 4px;
}

.upgrade-levels i {
  width: 19px;
  height: 5px;
  background: rgba(255, 255, 255, .12);
}

.upgrade-levels i.filled {
  background: var(--yellow);
}

.season-goal {
  display: grid;
  gap: 9px;
  margin: 2px 10px 16px;
  padding: 15px 11px 12px;
  border-top: 1px solid var(--line);
}

.season-goal.ready {
  border-top-color: rgba(237, 196, 90, .7);
  background: rgba(237, 196, 90, .055);
}

.season-goal header,
.career-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: .66rem;
  font-weight: 900;
}

.season-meter {
  height: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, .1);
}

.season-meter b {
  display: block;
  width: 0;
  height: 100%;
  background: var(--yellow);
  transition: width .3s ease;
}

.season-goal h3,
.season-goal p {
  margin: 0;
}

.season-goal h3 {
  font-size: .9rem;
}

.season-goal p {
  color: var(--muted);
  font-size: .69rem;
  line-height: 1.45;
}

.season-goal button {
  min-height: 40px;
  border: 1px solid rgba(237, 196, 90, .52);
  border-radius: 4px;
  background: var(--yellow);
  color: #242014;
  font-size: .7rem;
  font-weight: 950;
}

.crop-dock {
  position: fixed;
  z-index: 16;
  right: 390px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: max(14px, env(safe-area-inset-left));
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) 88px;
  align-items: stretch;
  min-height: 98px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(17, 32, 33, .91);
  box-shadow: 0 15px 36px rgba(0, 0, 0, .28);
  backdrop-filter: blur(10px);
}

.dock-heading {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 10px 12px;
  border-right: 1px solid var(--line);
}

.dock-heading small {
  color: var(--ink);
  font-size: .65rem;
  text-transform: none;
}

.crop-list {
  display: flex;
  min-width: 0;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: thin;
}

.crop-button {
  position: relative;
  display: grid;
  flex: 0 0 86px;
  grid-template-rows: 1fr auto;
  place-items: center;
  gap: 4px;
  padding: 10px 6px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
}

.crop-button:hover,
.crop-button.selected {
  background: rgba(255, 255, 255, .09);
}

.crop-button.selected::after {
  position: absolute;
  right: 9px;
  bottom: 0;
  left: 9px;
  height: 4px;
  background: var(--crop-color);
  content: "";
}

.crop-symbol {
  position: relative;
  width: 48px;
  height: 45px;
  background-image: var(--crop-image);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  filter: drop-shadow(0 5px 5px rgba(0, 0, 0, .34));
}

.crop-symbol::after {
  content: none;
}

.crop-button span:last-child {
  font-size: .62rem;
  font-weight: 900;
}

.crop-button.locked {
  filter: grayscale(.8);
  opacity: .5;
}

.seed-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
}

.seed-button strong {
  font-size: .75rem;
}

.mobile-panel-button {
  display: none;
}

.toast-region {
  position: fixed;
  z-index: 70;
  top: 91px;
  left: 50%;
  display: grid;
  gap: 6px;
  width: min(360px, calc(100vw - 30px));
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--yellow);
  border-radius: 4px;
  background: rgba(17, 30, 31, .96);
  box-shadow: 0 9px 24px rgba(0, 0, 0, .28);
  font-size: .75rem;
  font-weight: 850;
  animation: toast-in .18s ease-out;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-7px); }
}

.celebration {
  position: fixed;
  z-index: 60;
  top: 50%;
  left: 50%;
  display: flex;
  min-width: min(360px, calc(100vw - 30px));
  min-height: 150px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 6px;
  background: rgba(19, 37, 37, .95);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .42);
  transform: translate(-50%, -50%);
  animation: level-in .32s ease-out;
}

.celebration span,
.celebration small {
  color: var(--yellow);
  font-size: .7rem;
  font-weight: 900;
}

.celebration strong {
  margin: 3px 0;
  font-size: 2rem;
}

@keyframes level-in {
  from { opacity: 0; transform: translate(-50%, -45%) scale(.94); }
}

.settings-dialog {
  width: min(460px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #172b2d;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .5);
}

.settings-dialog::backdrop {
  background: rgba(7, 15, 17, .72);
  backdrop-filter: blur(5px);
}

.season-result-dialog {
  width: min(440px, calc(100vw - 28px));
  padding: 0;
  border: 1px solid rgba(237, 196, 90, .58);
  border-radius: 6px;
  background: #172b2d;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .55);
}

.level-complete-dialog {
  width: min(470px, calc(100vw - 28px));
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(237, 196, 90, .68);
  border-radius: 6px;
  background: #172b2d;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .56);
}

.level-complete-dialog::backdrop {
  background: rgba(7, 15, 17, .76);
  backdrop-filter: blur(6px);
}

.level-complete-dialog form {
  display: grid;
  gap: 13px;
  padding: 24px;
  text-align: center;
}

.level-complete-dialog form > small {
  color: var(--yellow);
  font-size: .68rem;
  font-weight: 950;
}

.level-complete-dialog h2,
.level-complete-dialog p {
  margin: 0;
}

.level-complete-dialog h2 {
  font-size: 1.55rem;
}

.level-complete-dialog p {
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.45;
}

.level-rewards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.level-rewards span {
  display: grid;
  min-height: 66px;
  place-content: center;
  gap: 3px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.level-rewards small {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 900;
}

.level-rewards b {
  color: var(--yellow);
  font-size: 1.05rem;
}

.level-unlock-list {
  display: grid;
  gap: 5px;
  text-align: left;
}

.level-unlock-list span {
  padding: 8px 10px;
  border-left: 3px solid var(--green);
  background: rgba(168, 203, 99, .08);
  font-size: .7rem;
  font-weight: 850;
}

.level-complete-dialog button {
  min-height: 46px;
  border: 0;
  border-radius: 4px;
  background: var(--green);
  color: #182018;
  font-size: .72rem;
  font-weight: 950;
}

.season-result-dialog::backdrop {
  background: rgba(7, 15, 17, .78);
  backdrop-filter: blur(7px);
}

.season-result-dialog form {
  display: grid;
  gap: 13px;
  padding: 22px;
  text-align: center;
}

.season-result-dialog form > small {
  color: var(--yellow);
  font-size: .68rem;
  font-weight: 950;
}

.season-result-dialog h2 {
  margin: 0;
  font-size: 1.45rem;
}

.season-result-dialog form > strong {
  color: var(--yellow);
  font-size: 1.95rem;
}

.season-result-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.season-result-stats span {
  display: grid;
  min-height: 62px;
  place-content: center;
  gap: 3px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.season-result-stats small {
  color: var(--muted);
  font-size: .58rem;
  font-weight: 900;
}

.season-result-dialog .share-button,
.season-continue-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 950;
}

.season-continue-button {
  background: var(--green);
  color: #182018;
}

.settings-dialog form {
  display: grid;
  gap: 0;
}

.settings-dialog header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px;
  border-bottom: 1px solid var(--line);
}

.settings-dialog h2 {
  margin: 2px 0 0;
  font-size: 1.25rem;
}

.range-setting,
.toggle-setting {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  min-height: 58px;
  padding: 10px 17px;
  border-bottom: 1px solid var(--line);
  font-size: .8rem;
  font-weight: 800;
}

.toggle-setting {
  grid-template-columns: 1fr auto;
}

.toggle-setting input {
  position: absolute;
  opacity: 0;
}

.toggle-setting b {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .18);
}

.toggle-setting b::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform .18s ease;
  content: "";
}

.toggle-setting input:checked + b {
  background: var(--green);
}

.toggle-setting input:checked + b::after {
  transform: translateX(20px);
}

.source-note {
  padding: 16px 17px;
  border-bottom: 1px solid var(--line);
}

.share-button {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(101, 196, 206, .12);
  color: var(--cyan);
  font-size: .72rem;
}

.share-button:hover {
  background: rgba(101, 196, 206, .2);
}

.share-button span {
  font-size: 1.05rem;
}

.source-note strong {
  font-size: .78rem;
}

.source-note p,
.source-note a {
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.45;
}

.source-note a {
  color: var(--cyan);
}

.reset-button {
  min-height: 48px;
  margin: 14px 17px 17px;
  border: 1px solid rgba(217, 83, 79, .65);
  border-radius: 4px;
  background: rgba(217, 83, 79, .09);
  color: #f2aaa6;
  font-size: .7rem;
  font-weight: 900;
}

@media (max-width: 760px) {
  .top-hud {
    top: max(7px, env(safe-area-inset-top));
    right: 7px;
    left: 7px;
    grid-template-columns: 37px minmax(90px, 1fr) 62px 76px 37px;
    min-height: 54px;
  }

  .farm-title {
    padding: 7px 9px;
  }

  .farm-title strong {
    font-size: .78rem;
  }

  .farm-title small {
    font-size: .5rem;
  }

  .hud-stat {
    padding: 7px 8px;
  }

  .hud-stat small {
    font-size: .5rem;
  }

  .hud-stat strong {
    font-size: .88rem;
  }

  .level-stat i {
    right: 6px;
    bottom: 5px;
    left: 6px;
  }

  .weather-stat {
    display: none;
  }

  .task-prompt {
    top: max(68px, calc(env(safe-area-inset-top) + 62px));
    left: 8px;
    max-width: calc(100vw - 16px);
    padding: 7px 10px;
    font-size: .63rem;
  }

  .camera-controls {
    bottom: max(116px, calc(env(safe-area-inset-bottom) + 109px));
    left: 8px;
    grid-template-columns: repeat(3, 38px);
  }

  .camera-controls button {
    width: 38px;
    height: 38px;
  }

  .crop-dock {
    right: 7px;
    bottom: max(7px, env(safe-area-inset-bottom));
    left: 7px;
    grid-template-columns: minmax(0, 1fr) 56px 56px 56px;
    min-height: 99px;
  }

  .dock-heading {
    display: none;
  }

  .crop-list {
    grid-column: 1;
  }

  .seed-button {
    display: flex;
    min-width: 0;
    padding: 3px;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--green);
    font-size: .52rem;
  }

  .seed-button strong {
    font-size: .58rem;
  }

  .crop-button {
    flex-basis: 69px;
    padding: 8px 4px 7px;
  }

  .crop-symbol {
    width: 43px;
    height: 41px;
  }

  .mobile-panel-button {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    border: 0;
    border-left: 1px solid var(--line);
    border-radius: 0;
    background: rgba(255, 255, 255, .04);
    color: var(--ink);
  }

  .mobile-panel-button span {
    max-width: 52px;
    overflow: hidden;
    font-size: .48rem;
  }

  .mobile-panel-button strong {
    font-size: 1rem;
  }

  .management-panel {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(64vh, 560px);
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 6px 6px 0 0;
    transform: translateY(105%);
    transition: transform .24s ease;
  }

  .management-panel.open {
    transform: translateY(0);
  }

  .panel-tabs {
    grid-template-columns: 1fr 1fr 48px;
  }

  .panel-tabs .panel-close {
    display: block;
    border-right: 0;
    color: var(--ink);
    font-size: 1.2rem;
  }

  .order-list,
  .upgrade-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toast-region {
    top: max(72px, calc(env(safe-area-inset-top) + 65px));
  }
}

@media (max-width: 470px) {
  .order-list,
  .upgrade-list {
    grid-template-columns: 1fr;
  }

  .inventory-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .panel-heading small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
