/* Farm toolbar and seed inventory */
.toolbar-panel {
  width: 432px;
  height: 64px;
  max-height: 64px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  overflow: visible;
  border: 2px solid #aa8747;
  border-radius: 14px;
  background: linear-gradient(180deg, #526833e8, #283c22ef);
  box-shadow: inset 0 1px #e9e6a66b, 0 5px 0 #1d2b1e99, 0 10px 24px #233b1b3b;
  -webkit-backdrop-filter: blur(9px);
  backdrop-filter: blur(9px);
}
.toolbar-panel hr { display: none; }
.dock-action {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 174px;
  min-width: 174px;
  height: 48px;
  padding: 4px 9px 4px 5px;
  border: 1px solid #ecd881;
  border-radius: 10px;
  background: linear-gradient(180deg, #fffbd8, #e8ecc3);
  color: #344a2b;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  box-shadow: inset 0 1px #fff, 0 2px 0 #1d2b1d66;
}
.dock-action:hover { background: linear-gradient(180deg, #fffce7, #f4e8a8); transform: translateY(-1px); }
.dock-action.is-planting { border-color: #ffd25b; background: linear-gradient(180deg, #fff7b3, #efc65c); box-shadow: inset 0 0 0 2px #fff4a0, 0 2px 0 #553f1f88; }
.dock-action:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.dock-icon { width: 38px; height: 38px; flex: 0 0 38px; object-fit: contain; filter: drop-shadow(0 2px 1px #28351d55); }
.toolbar-copy { min-width: 0; }
.dock-action b { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; }
.dock-action small { display: block; max-width: 104px; margin-top: 3px; overflow: hidden; color: #65704d; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.seed-badge { display: inline-block; max-width: 54px; overflow: hidden; padding: 1px 6px; border-radius: 9px; background: #3d6335; color: #fff; font: 10px 'Trebuchet MS', sans-serif; text-overflow: ellipsis; }
.toolbar-divider { align-self: stretch; width: 1px; margin: 3px 0; background: linear-gradient(transparent, #f4dc7b88 16% 84%, transparent); box-shadow: 1px 0 #15241888; }
.toolbar-panel .tool-list { display: grid; grid-template-columns: repeat(4, 48px); gap: 5px; margin: 0; }
.toolbar-panel .tool {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 3px;
  border: 1px solid #bba25b;
  border-radius: 10px;
  background: linear-gradient(180deg, #f7f0b8, #a8bf62);
  color: #fff;
  cursor: pointer;
  box-shadow: inset 0 1px #ffffd6, 0 2px 0 #18291a99;
  transition: transform 120ms ease, filter 120ms ease, background 120ms ease;
}
.toolbar-panel .tool:hover { transform: translateY(-2px); filter: brightness(1.08); }
.toolbar-panel .tool:active { transform: translateY(1px); }
.toolbar-panel .tool.active { border-color: #ffcd47; background: linear-gradient(180deg, #ffe886, #e49b34); box-shadow: inset 0 0 0 2px #fff2a0, 0 2px 0 #563d1e; }
.toolbar-panel .tool-clear.active { border-color: #e98c57; background: linear-gradient(180deg, #f7bd7d, #b65e34); }
.toolbar-panel .tool:disabled { cursor: not-allowed; opacity: .48; transform: none; filter: grayscale(.35); }
.tool-icon { display: block; width: 40px; height: 40px; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 1px #24351e55); }
.tool-label {
  display: block;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 30;
  width: max-content;
  max-width: 130px;
  padding: 5px 8px;
  border: 1px solid #dfc56d;
  border-radius: 7px;
  background: #2e4228ee;
  color: #fffde3;
  box-shadow: 0 3px 8px #17251455;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 120ms ease, transform 120ms ease;
}
.tool:hover .tool-label, .tool:focus-visible .tool-label { opacity: 1; transform: translate(-50%, 0); }
.toolbar-panel button:focus-visible { outline: 3px solid #ffe477; outline-offset: 2px; }

.seed-modal-open { overflow: hidden; }
.seed-dialog { width: min(540px, calc(100% - 28px)); max-width: none; max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain; border: 2px solid #ac8750; border-radius: 20px; background: #faf7e9; color: #433c28; box-shadow: 0 18px 60px #203a2855; font-family: 'Trebuchet MS', -apple-system, sans-serif; }
.seed-dialog::backdrop { background: #1f332aa6; }
.seed-dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 22px 14px; background: #eff1d5; border-bottom: 1px solid #d9ddbd; }
.seed-eyebrow { font-size: 12px; font-weight: bold; letter-spacing: 1.5px; color: #73834b; }
.seed-dialog h2 { margin: 5px 0 0; font-size: 23px; color: #39562f; }
.seed-close { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid #bac79f; border-radius: 12px; background: #fafbea; color: #456037; font-size: 28px; cursor: pointer; }
.seed-dialog-summary { padding: 16px 22px 12px; }
.seed-dialog-summary p { margin: 0; color: #786e52; font-size: 14px; line-height: 1.5; }
.seed-dialog-controls { min-width: 0; margin: 0; padding: 0 22px; border: 0; }
.seed-cards { display: grid; gap: 10px; }
.seed-card { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 10px 12px; padding: 14px; border: 1px solid #dfd8b8; border-radius: 14px; background: #fffdf3; }
.seed-item-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 13px; background: #ecf0d3; font-size: 30px; }
.seed-item-copy h3 { margin: 0 0 5px; font-size: 16px; color: #465c32; }
.seed-item-copy p { margin: 0; color: #726141; font-size: 14px; line-height: 1.4; }
.seed-item-copy small { display: block; margin-top: 4px; color: #8b8062; font-size: 12px; line-height: 1.5; }
.seed-choose { min-height: 44px; padding: 10px 14px; border: 1px solid #496a34; border-radius: 10px; background: #577b40; color: white; cursor: pointer; font: bold 13px 'Trebuchet MS', sans-serif; }
.seed-dialog button:disabled { cursor: not-allowed; opacity: .55; }
.seed-empty { padding: 26px 20px; border: 1px dashed #bcc6a0; border-radius: 14px; background: #f2f4df; color: #65734c; text-align: center; font-size: 14px; line-height: 1.6; }
.seed-dialog-message { margin: 12px 22px 0; color: #416532; font-size: 13px; line-height: 1.5; }
.seed-dialog-message:empty { display: none; }
.seed-dialog-footer { padding: 16px 22px 20px; }
.seed-dialog-footer span { color: #897b5f; font-size: 12px; line-height: 1.5; }
.seed-dialog button:focus-visible, .seed-dialog input:focus-visible { outline: 3px solid #d7a640; outline-offset: 2px; }

@media (max-width: 979px) {
  :root { --dock-space: calc(92px + env(safe-area-inset-bottom, 0px)); }
  .toolbar-panel {
    position: fixed;
    z-index: 20;
    inset: auto 0 0;
    width: auto;
    min-width: 0;
    height: auto;
    max-height: none;
    padding: 8px var(--page-right) calc(8px + env(safe-area-inset-bottom, 0px)) var(--page-left);
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    border: 0;
    border-top: 1px solid #d7c678;
    border-radius: 18px 18px 0 0;
    background: linear-gradient(180deg, #445d31ee, #263b25f5);
    box-shadow: 0 -5px 24px #263c233d, inset 0 1px #e7dda65c;
  }
  .toolbar-divider { display: none; }
  .dock-action, .toolbar-panel .tool {
    width: 100%;
    min-width: 0;
    height: 66px;
    padding: 4px 2px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    border-radius: 11px;
  }
  .dock-action { border-color: #d6d08e; background: linear-gradient(180deg, #f8f2bd, #c2d080); }
  .dock-icon, .tool-icon { width: 36px; height: 36px; flex-basis: 36px; }
  .toolbar-copy b { font-size: 10px; line-height: 1; }
  .toolbar-copy small { display: none; }
  .seed-badge { position: absolute; top: 3px; right: 3px; max-width: 38px; padding: 1px 4px; font-size: 9px; }
  .inventory-action { position: relative; }
  .toolbar-panel .tool-list { display: contents; }
  .tool-label { position: static; width: auto; max-width: none; padding: 0; border: 0; background: transparent; color: #f9f7dc; box-shadow: none; font-size: 10px; line-height: 1; opacity: 1; transform: none; }
  .toolbar-panel .tool.active .tool-label { color: #493315; }
}

@media (max-width: 420px) {
  .seed-dialog-header { padding: 16px 14px 12px; }
  .seed-dialog h2 { font-size: 19px; }
  .seed-dialog-summary { padding: 12px 14px; }
  .seed-dialog-controls { padding: 0 14px; }
  .seed-card { grid-template-columns: 44px minmax(0, 1fr); padding: 12px; }
  .seed-item-icon { width: 44px; height: 44px; }
  .seed-choose { grid-column: 2; width: 100%; }
  .seed-dialog-message { margin-left: 14px; margin-right: 14px; }
  .seed-dialog-footer { padding: 14px; }
}

@media (min-width: 600px) and (max-width: 979px) and (max-height: 500px) {
  :root { --dock-space: calc(78px + env(safe-area-inset-bottom, 0px)); }
  .dock-action, .toolbar-panel .tool { height: 58px; }
  .dock-icon, .tool-icon { width: 31px; height: 31px; flex-basis: 31px; }
}
