/* Ivory paper carries the implements; a single vermilion seal marks the one in hand. */
.dock-hud {
  --tray-paper: #faf6e8;
  --tray-face: #f7f3e6;
  --tray-rule: #bbb898;
  --tray-ink: #344b3b;
  --tray-soft: #59654f;
  --tray-red: #9c432f;
  --tray-shadow: 0 2px 6px #43442b23;
}
.dock-hud .toolrack {
  border: 1px solid var(--tray-rule);
  border-radius: 15px;
  background: var(--tray-paper);
  box-shadow: inset 0 0 0 2px #fffdf3, var(--tray-shadow);
  gap: 5px;
}
.dock-hud .slot,
.dock-hud .seed-pick {
  border: 1px solid #cbc8ac;
  border-radius: 10px;
  color: var(--tray-ink);
  background: linear-gradient(160deg,#fbf8ee,#f3efdf);
  box-shadow: none;
}
.dock-hud .slot img, .dock-hud .seed-pick img,
.dock-hud .slot[aria-pressed="true"] img, .dock-hud .quick-seed img {
  image-rendering: auto;
  filter: none;
  object-fit: contain;
}
.dock-hud .slot kbd { display: none; }
.dock-hud .slot span { color: #394638; font-family: var(--book); font-weight: 700; }
.dock-hud .slot[aria-pressed="true"] {
  border-color: var(--tray-red);
  color: var(--tray-ink);
  background: #f9f2e5;
  box-shadow: inset 0 0 0 1px var(--tray-red);
}
.dock-hud .slot[aria-pressed="true"]::after {
  content: "✓";
  position: absolute;
  display: grid;
  place-items: center;
  top: 4px; right: 4px;
  width: 14px; height: 14px;
  transform: none;
  border-radius: 50%;
  background: var(--tray-red);
  color: #fffdf1;
  font: bold 11px/1 system-ui,sans-serif;
}
.dock-hud .seed-pick, .dock-hud .seed-pick[aria-expanded="true"] {
  background: #f2f0df;
  border-color: #b9bd9d;
  box-shadow: none;
}
.dock-hud .seed-label, .dock-hud .seed-label small,
.dock-hud .seed-label b { color: var(--tray-ink); }
.dock-hud .seed-label, .dock-hud .seed-label small { color: var(--tray-soft); }
.dock-hud .seed-pick i { border-color: #778163; }
.dock-hud .hint {
  background: #fbf7eaf2;
  border: 1px solid #c5c4a7;
  box-shadow: 0 1px 3px #4f533325;
  color: var(--tray-ink);
  border-radius: 12px;
}
.dock-hud .hint #status.warn { color: #883b25; }
.dock-hud .hint svg { color: #6d865c; }
.dock-hud #nudge, .quick-seeds-head button {
  color: #39543f;
  background: #e9edda;
  border-color: #a1ae8b;
  border-radius: 6px;
}
.dock-hud #nudge:hover, .quick-seeds-head button:hover {
  color: #324d36;
  background: #e0e7d0;
}
.dock-hud .quick-seeds {
  background: #f9f5e8;
  color: var(--tray-ink);
  border-color: var(--tray-rule);
  border-radius: 13px;
  box-shadow: inset 0 0 0 2px #fffdf4, var(--tray-shadow);
}
.quick-seeds-head > :first-child { color: var(--tray-ink); }
.dock-hud .quick-seed {
  background: #f9f5e9;
  border-color: #c4c4a8;
  border-radius: 7px;
  color: var(--tray-ink);
}
.dock-hud .quick-seed small { color: var(--tray-soft); }
.dock-hud .quick-seed[aria-pressed="true"] {
  color: #34523e;
  border-color: #849572;
  background: #edf0dd;
  box-shadow: inset 0 0 0 1px #a5b18f;
}
.dock-hud .quick-seed:disabled {
  color: #636b5c;
  background: #f0ede1;
  border-color: #d1ceba;
}
.dock-hud .quick-seed:disabled small { color: #636b5c; }
.dock-hud :is(.slot,.seed-pick,.quick-seed,.quick-seeds-head button,#nudge):focus-visible {
  outline: 2px solid #395e54;
  outline-offset: 1px;
  box-shadow: 0 0 0 3px #fff9df;
}
@media (hover: hover) {
  .dock-hud .slot[aria-pressed="false"]:hover,
  .dock-hud .seed-pick:hover,
  .dock-hud .quick-seed:not([aria-pressed="true"]):enabled:hover,
  .dock-hud .quick-seeds-head button:hover {
    color: #304d38;
    background: #eef0dc;
    border-color: #9aa984;
  }
}

@media (orientation:landscape) and (min-width:1120px) and (min-height:700px) {
  .dock-hud, .dock-hud:has(.quick-seeds:not([hidden])) {
    --pocket-right: max(1.8vw,env(safe-area-inset-right));
    --pocket-width: clamp(172px,16vw,240px);
    --pocket-top: 60.5dvh;
    --pocket-bottom: max(80px,calc(var(--safe-bottom) + 63px));
    --tool-height: clamp(70px,9.35vh,95px);
    --tool-art: clamp(39px,5.55vh,59px);
    left: 0; right: 0;
    transform: none;
    width: auto; max-width:none;
    align-items:center; pointer-events:none;
    bottom: max(12px,1.75vh,env(safe-area-inset-bottom));
  }
  .dock-hud .toolrack {
    padding: 6px 7px;
    gap: 6px;
    border-radius: 19px;
  }
  .dock-hud .toolrack #tools {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 4px;
    width: clamp(460px,35vw,630px);
  }
  .dock-hud .slot {
    width: 100%; min-width: 0;
    gap: 1px; padding: 3px 6px 6px;
    border-radius: 13px;
  }
  .dock-hud .slot span { font-size:clamp(16px,1.14vw,21px); letter-spacing:.07em; }
  .dock-hud .slot img { width:calc(var(--tool-art)*1.19); height:var(--tool-art); }
  .dock-hud .slot[aria-pressed="true"]::after { top: 6px; right: 6px; width:18px; height:18px; font-size:13px; }
  .dock-hud .hint { font-size:14px; padding:4px 12px; }
  .viewport:not([data-panel]) .dock-hud .toolrack:has(.quick-seeds:not([hidden])) #tools { display: grid; }
  .viewport:not([data-panel]) .dock-hud:has(.quick-seeds:not([hidden])) .hint { visibility:visible; }
  .viewport:not([data-panel]):has(#waterFloat:not([hidden])) .dock-hud {
    --pocket-top: calc(61dvh + 29px);
  }
  .viewport:not([data-panel]) #seedToggle {
    position: fixed;
    right: var(--pocket-right);
    top: var(--pocket-top);
    z-index: 3;
    width: var(--pocket-width);
    min-height: 51px;
    padding: 6px 12px;
    background: var(--tray-paper);
    border: 1px solid var(--tray-rule);
    box-shadow:var(--tray-shadow);
  }
  .viewport:not([data-panel]) #seedToggle .seed-label {
    display:flex; align-items:baseline; gap:6px;
    flex-wrap:wrap; font-family:var(--book); font-weight:700;
  }
  .viewport:not([data-panel]) #seedToggle .seed-label b { font:650 13px var(--font); }
  .viewport:not([data-panel]) #seedToggle:not([aria-expanded="true"]) i { margin-left:auto; }
  .viewport:not([data-panel]) #seedToggle[aria-expanded="true"] {
    left:auto; right:calc(var(--pocket-right) + 90px);
    width:calc(var(--pocket-width) - 97px);
    min-height:38px;
    margin-top:4px;
    padding:3px 6px 3px 8px;
    gap:4px;
    background:transparent;
    border:0; box-shadow:none;
  }
  .viewport:not([data-panel]) #seedToggle[aria-expanded="true"] img {
    width:24px; height:24px;
  }
  .viewport:not([data-panel]) #seedToggle[aria-expanded="true"] .seed-label {
    white-space:nowrap; font:700 clamp(16px,1.27vw,21px)/1.1 var(--book); color:var(--tray-ink);
  }
  .viewport:not([data-panel]) #seedToggle[aria-expanded="true"] :is(.seed-label b,.seed-label small) { display:none; }
  .viewport:not([data-panel]) .dock-hud .quick-seeds:not([hidden]) {
    display:block;
    position:fixed; width:var(--pocket-width);
    top:var(--pocket-top); right:var(--pocket-right); bottom:auto; left:auto;
    padding:0 7px 7px;
    border:1px solid var(--tray-rule); border-radius:15px;
    background:var(--tray-paper); box-shadow:inset 0 0 0 2px #fffdf4,var(--tray-shadow);
    pointer-events:auto;
  }
  .viewport:not([data-panel]) .quick-seeds-head {
    height:44px; flex-direction:row; justify-content:flex-end; align-items:center; gap:4px;
    margin:0 2px 3px;
  }
  .viewport:not([data-panel]) #quickSeedTitle { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
  .viewport:not([data-panel]) .quick-seeds-head button { min-height:28px; padding:2px 6px; }
  .viewport:not([data-panel]) #closeSeeds { flex:none; width:27px; min-height:28px; padding:3px; }
  .viewport:not([data-panel]) #closeSeeds svg { width:15px; height:15px; vertical-align:middle; }
  .viewport:not([data-panel]) .quick-seed-list {
    grid-template-columns:minmax(0,1fr);
    gap:4px; overflow-y:auto;
    max-height:calc(100dvh - var(--pocket-top) - var(--pocket-bottom) - 57px);
    overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#adba98 #f5f0e2;
  }
  .viewport:not([data-panel]) .quick-seed {
    display:grid; grid-template-columns:clamp(30px,3.2vw,48px) minmax(0,1fr) auto;
    grid-template-rows:auto;
    justify-content:stretch; justify-items:start; align-items:center; text-align:left;
    gap:5px;
    min-height:clamp(41px,4.9vh,57px);
    padding:3px 8px; border-radius:9px;
  }
  .viewport:not([data-panel]) .quick-seed:disabled { display:none; }
  .viewport:not([data-panel]) .quick-seed img {
    display:block; grid-area:1/1;
    width:100%; height:38px; max-width:48px;
  }
  .viewport:not([data-panel]) .quick-seed .quick-seed-name { grid-area:1/2; font:700 clamp(14px,1.13vw,19px) var(--book); }
  .viewport:not([data-panel]) .quick-seed small { grid-area:1/3; font-size:clamp(12px,.94vw,15px); font-variant-numeric:tabular-nums; }
}

@media (orientation:landscape) and (min-width:1120px) and (max-width:1249px) and (min-height:700px) {
  .viewport:not([data-panel]) #seedToggle[aria-expanded="true"] img { display:none; }
}
/* The dock is a compact pocket in portrait and short landscape windows. */
@media (orientation:portrait) {
  .dock-hud .slot { border-radius:8px; }
  .dock-hud .slot img { width:calc(var(--tool-art)*1.15); }
  .dock-hud .seed-pick { border-radius:8px; }
  .dock-hud .slot[aria-pressed="true"]::after { top:3px; right:3px; width:12px; height:12px; font-size:10px; }
}
@media (orientation:landscape) and (max-height:820px), (orientation:portrait) and (max-height:545px) {
  .dock-hud .quick-seeds { border-radius:0; background:none; box-shadow:none; }
}
